Browse Source

Use AttributedNode;

Fix enums
pull/219/head
Eusebiu Marcu 14 years ago
parent
commit
6cbd5519ff
  1. 4
      ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs
  2. 3
      ILSpy/Bookmarks/MemberBookmark.cs
  3. 9
      ILSpy/Language.cs

4
ICSharpCode.Decompiler/Ast/TextOutputFormatter.cs

@ -145,9 +145,7 @@ namespace ICSharpCode.Decompiler.Ast @@ -145,9 +145,7 @@ namespace ICSharpCode.Decompiler.Ast
}
// definitions of types and their members
Predicate<AstNode> predicate = n => n is TypeDeclaration || n is DelegateDeclaration ||
n is FieldDeclaration || n is PropertyDeclaration || n is EventDeclaration ||n is MethodDeclaration || n is ConstructorDeclaration ||
n is IndexerDeclaration || n is OperatorDeclaration;
Predicate<AstNode> predicate = n => n is AttributedNode;
if (predicate(node)) {
var n = node as AttributedNode;

3
ILSpy/Bookmarks/MemberBookmark.cs

@ -35,6 +35,9 @@ namespace ICSharpCode.ILSpy.Bookmarks @@ -35,6 +35,9 @@ namespace ICSharpCode.ILSpy.Bookmarks
public virtual ImageSource Image {
get {
var attrNode = (AttributedNode)node;
if (node is EnumMemberDeclaration)
return GetMemberOverlayedImage(attrNode, MemberIcon.EnumValue);
if (node is FieldDeclaration)
return GetMemberOverlayedImage(attrNode, MemberIcon.Field);

9
ILSpy/Language.cs

@ -191,12 +191,7 @@ namespace ICSharpCode.ILSpy @@ -191,12 +191,7 @@ namespace ICSharpCode.ILSpy
CodeMappings = builder.CodeMappings,
LocalVariables = builder.LocalVariables,
DecompiledMemberReferences = builder.DecompiledMemberReferences,
AstNodes = builder.CompilationUnit.GetNodesWithLineNumbers(n =>
n is TypeDeclaration || n is DelegateDeclaration ||
n is FieldDeclaration || n is PropertyDeclaration ||
n is EventDeclaration || n is MethodDeclaration ||
n is ConstructorDeclaration ||
n is IndexerDeclaration || n is OperatorDeclaration)
AstNodes = builder.CompilationUnit.GetNodesWithLineNumbers(n => n is AttributedNode)
});
}
@ -205,7 +200,7 @@ namespace ICSharpCode.ILSpy @@ -205,7 +200,7 @@ namespace ICSharpCode.ILSpy
OnDecompilationFinished(new DecompileEventArgs {
CodeMappings = dis.CodeMappings,
DecompiledMemberReferences = dis.DecompiledMemberReferences,
AstNodes = null // TODO: how can I find the AST nodes?
AstNodes = null // TODO: how can I find the nodes with line numbers from dis?
});
}
}

Loading…
Cancel
Save