|
|
|
@ -600,6 +600,7 @@ namespace Decompiler
@@ -600,6 +600,7 @@ namespace Decompiler
|
|
|
|
|
attribute.Type = ConvertType(customAttribute.AttributeType); |
|
|
|
|
section.Attributes.Add(attribute); |
|
|
|
|
|
|
|
|
|
if(customAttribute.HasConstructorArguments) |
|
|
|
|
foreach (var parameter in customAttribute.ConstructorArguments) |
|
|
|
|
{ |
|
|
|
|
var isEnum = parameter.Type.IsValueType && !parameter.Type.IsPrimitive; |
|
|
|
@ -615,6 +616,14 @@ namespace Decompiler
@@ -615,6 +616,14 @@ namespace Decompiler
|
|
|
|
|
attribute.Arguments.Add(parameterValue); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (customAttribute.HasProperties) |
|
|
|
|
foreach (var property in customAttribute.Properties) |
|
|
|
|
{ |
|
|
|
|
var propertyReference = customAttribute.AttributeType.Resolve().Properties.First(pr => pr.Name == property.Name); |
|
|
|
|
var propertyName = new IdentifierExpression(property.Name).WithAnnotation(propertyReference); |
|
|
|
|
var propertyArgument = new PrimitiveExpression(property.Argument.Value); |
|
|
|
|
attribute.Arguments.Add(new AssignmentExpression(propertyName, propertyArgument)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
attributedNode.Attributes.Add(section); |
|
|
|
|