|
|
@ -181,7 +181,7 @@ namespace ICSharpCode.Decompiler.Ast |
|
|
|
Type = new SimpleType("AssemblyVersion") |
|
|
|
Type = new SimpleType("AssemblyVersion") |
|
|
|
.WithAnnotation(new TypeReference( |
|
|
|
.WithAnnotation(new TypeReference( |
|
|
|
"System.Reflection", "AssemblyVersionAttribute", |
|
|
|
"System.Reflection", "AssemblyVersionAttribute", |
|
|
|
moduleDefinition, moduleDefinition.TypeSystem.Corlib)), |
|
|
|
moduleDefinition, moduleDefinition.TypeSystem.CoreLibrary)), |
|
|
|
Arguments = { |
|
|
|
Arguments = { |
|
|
|
new PrimitiveExpression(moduleDefinition.Assembly.Name.Version.ToString()) |
|
|
|
new PrimitiveExpression(moduleDefinition.Assembly.Name.Version.ToString()) |
|
|
|
} |
|
|
|
} |
|
|
@ -225,7 +225,7 @@ namespace ICSharpCode.Decompiler.Ast |
|
|
|
Type = new SimpleType("TypeForwardedTo") |
|
|
|
Type = new SimpleType("TypeForwardedTo") |
|
|
|
.WithAnnotation(new TypeReference( |
|
|
|
.WithAnnotation(new TypeReference( |
|
|
|
"System.Runtime.CompilerServices", "TypeForwardedToAttribute", |
|
|
|
"System.Runtime.CompilerServices", "TypeForwardedToAttribute", |
|
|
|
module, module.TypeSystem.Corlib)), |
|
|
|
module, module.TypeSystem.CoreLibrary)), |
|
|
|
Arguments = { forwardedType } |
|
|
|
Arguments = { forwardedType } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1264,7 +1264,7 @@ namespace ICSharpCode.Decompiler.Ast |
|
|
|
Ast.Attribute methodImpl = CreateNonCustomAttribute(typeof(MethodImplAttribute)); |
|
|
|
Ast.Attribute methodImpl = CreateNonCustomAttribute(typeof(MethodImplAttribute)); |
|
|
|
TypeReference methodImplOptions = new TypeReference( |
|
|
|
TypeReference methodImplOptions = new TypeReference( |
|
|
|
"System.Runtime.CompilerServices", "MethodImplOptions", |
|
|
|
"System.Runtime.CompilerServices", "MethodImplOptions", |
|
|
|
methodDefinition.Module, methodDefinition.Module.TypeSystem.Corlib); |
|
|
|
methodDefinition.Module, methodDefinition.Module.TypeSystem.CoreLibrary); |
|
|
|
methodImpl.Arguments.Add(MakePrimitive((long)implAttributes, methodImplOptions)); |
|
|
|
methodImpl.Arguments.Add(MakePrimitive((long)implAttributes, methodImplOptions)); |
|
|
|
attributedNode.Attributes.Add(new AttributeSection(methodImpl)); |
|
|
|
attributedNode.Attributes.Add(new AttributeSection(methodImpl)); |
|
|
|
} |
|
|
|
} |
|
|
@ -1311,7 +1311,7 @@ namespace ICSharpCode.Decompiler.Ast |
|
|
|
{ |
|
|
|
{ |
|
|
|
MarshalInfo marshalInfo = marshalInfoProvider.MarshalInfo; |
|
|
|
MarshalInfo marshalInfo = marshalInfoProvider.MarshalInfo; |
|
|
|
Ast.Attribute attr = CreateNonCustomAttribute(typeof(MarshalAsAttribute), module); |
|
|
|
Ast.Attribute attr = CreateNonCustomAttribute(typeof(MarshalAsAttribute), module); |
|
|
|
var unmanagedType = new TypeReference("System.Runtime.InteropServices", "UnmanagedType", module, module.TypeSystem.Corlib); |
|
|
|
var unmanagedType = new TypeReference("System.Runtime.InteropServices", "UnmanagedType", module, module.TypeSystem.CoreLibrary); |
|
|
|
attr.Arguments.Add(MakePrimitive((int)marshalInfo.NativeType, unmanagedType)); |
|
|
|
attr.Arguments.Add(MakePrimitive((int)marshalInfo.NativeType, unmanagedType)); |
|
|
|
|
|
|
|
|
|
|
|
FixedArrayMarshalInfo fami = marshalInfo as FixedArrayMarshalInfo; |
|
|
|
FixedArrayMarshalInfo fami = marshalInfo as FixedArrayMarshalInfo; |
|
|
@ -1322,7 +1322,7 @@ namespace ICSharpCode.Decompiler.Ast |
|
|
|
} |
|
|
|
} |
|
|
|
SafeArrayMarshalInfo sami = marshalInfo as SafeArrayMarshalInfo; |
|
|
|
SafeArrayMarshalInfo sami = marshalInfo as SafeArrayMarshalInfo; |
|
|
|
if (sami != null && sami.ElementType != VariantType.None) { |
|
|
|
if (sami != null && sami.ElementType != VariantType.None) { |
|
|
|
var varEnum = new TypeReference("System.Runtime.InteropServices", "VarEnum", module, module.TypeSystem.Corlib); |
|
|
|
var varEnum = new TypeReference("System.Runtime.InteropServices", "VarEnum", module, module.TypeSystem.CoreLibrary); |
|
|
|
attr.AddNamedArgument("SafeArraySubType", MakePrimitive((int)sami.ElementType, varEnum)); |
|
|
|
attr.AddNamedArgument("SafeArraySubType", MakePrimitive((int)sami.ElementType, varEnum)); |
|
|
|
} |
|
|
|
} |
|
|
|
ArrayMarshalInfo ami = marshalInfo as ArrayMarshalInfo; |
|
|
|
ArrayMarshalInfo ami = marshalInfo as ArrayMarshalInfo; |
|
|
@ -1359,7 +1359,7 @@ namespace ICSharpCode.Decompiler.Ast |
|
|
|
Ast.Attribute attr = new Ast.Attribute(); |
|
|
|
Ast.Attribute attr = new Ast.Attribute(); |
|
|
|
attr.Type = new SimpleType(attributeType.Name.Substring(0, attributeType.Name.Length - "Attribute".Length)); |
|
|
|
attr.Type = new SimpleType(attributeType.Name.Substring(0, attributeType.Name.Length - "Attribute".Length)); |
|
|
|
if (module != null) { |
|
|
|
if (module != null) { |
|
|
|
attr.Type.AddAnnotation(new TypeReference(attributeType.Namespace, attributeType.Name, module, module.TypeSystem.Corlib)); |
|
|
|
attr.Type.AddAnnotation(new TypeReference(attributeType.Namespace, attributeType.Name, module, module.TypeSystem.CoreLibrary)); |
|
|
|
} |
|
|
|
} |
|
|
|
return attr; |
|
|
|
return attr; |
|
|
|
} |
|
|
|
} |
|
|
@ -1461,7 +1461,7 @@ namespace ICSharpCode.Decompiler.Ast |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var module = secAttribute.AttributeType.Module; |
|
|
|
var module = secAttribute.AttributeType.Module; |
|
|
|
var securityActionType = new TypeReference("System.Security.Permissions", "SecurityAction", module, module.TypeSystem.Corlib); |
|
|
|
var securityActionType = new TypeReference("System.Security.Permissions", "SecurityAction", module, module.TypeSystem.CoreLibrary); |
|
|
|
attribute.Arguments.Add(MakePrimitive((int)secDecl.Action, securityActionType)); |
|
|
|
attribute.Arguments.Add(MakePrimitive((int)secDecl.Action, securityActionType)); |
|
|
|
|
|
|
|
|
|
|
|
if (secAttribute.HasProperties) { |
|
|
|
if (secAttribute.HasProperties) { |
|
|
|