diff --git a/ICSharpCode.Decompiler/Ast/AstBuilder.cs b/ICSharpCode.Decompiler/Ast/AstBuilder.cs index b4ed67ac3..3a30aae48 100644 --- a/ICSharpCode.Decompiler/Ast/AstBuilder.cs +++ b/ICSharpCode.Decompiler/Ast/AstBuilder.cs @@ -578,10 +578,14 @@ namespace Decompiler foreach (var customAttribute in customAttributeProvider.CustomAttributes) { ICSharpCode.NRefactory.CSharp.Attribute attribute = new ICSharpCode.NRefactory.CSharp.Attribute(); - //customAttribute. attribute.Type = ConvertType(customAttribute.AttributeType); section.Attributes.Add(attribute); + foreach (var parameter in customAttribute.ConstructorArguments) + { + attribute.Arguments.Add(new PrimitiveExpression(parameter.Value)); + } + } attributedNode.Attributes.Add(section); diff --git a/ICSharpCode.Decompiler/Tests/CustomAttributes.cs b/ICSharpCode.Decompiler/Tests/CustomAttributes.cs index fa12ffa9b..17f1a55ed 100644 --- a/ICSharpCode.Decompiler/Tests/CustomAttributes.cs +++ b/ICSharpCode.Decompiler/Tests/CustomAttributes.cs @@ -9,7 +9,11 @@ public static class CustomAtributes [Flags] public enum EnumWithFlag { - Item1, +// Item1, Item2 } + [Obsolete("some message")] + public static void ObsoletedMethod() + { + } } diff --git a/NRefactory/ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/Attribute.cs b/NRefactory/ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/Attribute.cs index 877771736..b5a44275b 100644 --- a/NRefactory/ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/Attribute.cs +++ b/NRefactory/ICSharpCode.NRefactory/CSharp/Ast/GeneralScope/Attribute.cs @@ -25,12 +25,14 @@ // THE SOFTWARE. using System.Collections.Generic; +using System.Diagnostics; namespace ICSharpCode.NRefactory.CSharp { /// /// Attribute(Arguments) /// + [DebuggerDisplay("Attribute {Type}")] public class Attribute : AstNode { public override NodeType NodeType {