|
|
|
@ -42,35 +42,28 @@ namespace ICSharpCode.ILSpy.TreeNodes
@@ -42,35 +42,28 @@ namespace ICSharpCode.ILSpy.TreeNodes
|
|
|
|
|
this.LazyLoading = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public TypeDefinition TypeDefinition |
|
|
|
|
{ |
|
|
|
|
public TypeDefinition TypeDefinition { |
|
|
|
|
get { return type; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public AssemblyTreeNode ParentAssemblyNode |
|
|
|
|
{ |
|
|
|
|
public AssemblyTreeNode ParentAssemblyNode { |
|
|
|
|
get { return parentAssemblyNode; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public string Name |
|
|
|
|
{ |
|
|
|
|
public string Name { |
|
|
|
|
get { return type.Name; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public string Namespace |
|
|
|
|
{ |
|
|
|
|
public string Namespace { |
|
|
|
|
get { return type.Namespace; } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override object Text |
|
|
|
|
{ |
|
|
|
|
public override object Text { |
|
|
|
|
get { return HighlightSearchMatch(this.Language.TypeToString(type, includeNamespace: false)); } |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public bool IsPublicAPI |
|
|
|
|
{ |
|
|
|
|
get |
|
|
|
|
{ |
|
|
|
|
public bool IsPublicAPI { |
|
|
|
|
get { |
|
|
|
|
switch (type.Attributes & TypeAttributes.VisibilityMask) { |
|
|
|
|
case TypeAttributes.Public: |
|
|
|
|
case TypeAttributes.NestedPublic: |
|
|
|
@ -153,10 +146,8 @@ namespace ICSharpCode.ILSpy.TreeNodes
@@ -153,10 +146,8 @@ namespace ICSharpCode.ILSpy.TreeNodes
|
|
|
|
|
} else { |
|
|
|
|
if (type.IsInterface) |
|
|
|
|
return TypeIcon.Interface; |
|
|
|
|
else if (IsDelegate(type)) |
|
|
|
|
else if (type.BaseType != null && type.BaseType.FullName == typeof(MulticastDelegate).FullName) |
|
|
|
|
return TypeIcon.Delegate; |
|
|
|
|
else if (IsStaticClass(type)) |
|
|
|
|
return TypeIcon.StaticClass; |
|
|
|
|
else |
|
|
|
|
return TypeIcon.Class; |
|
|
|
|
} |
|
|
|
@ -187,28 +178,9 @@ namespace ICSharpCode.ILSpy.TreeNodes
@@ -187,28 +178,9 @@ namespace ICSharpCode.ILSpy.TreeNodes
|
|
|
|
|
} |
|
|
|
|
return overlay; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static bool IsDelegate(TypeDefinition type) |
|
|
|
|
{ |
|
|
|
|
return type.BaseType != null && type.BaseType.FullName == typeof(MulticastDelegate).FullName; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static bool IsStaticClass(TypeDefinition type) |
|
|
|
|
{ |
|
|
|
|
if (type.IsSealed) { |
|
|
|
|
if (type.IsAbstract) |
|
|
|
|
return true; |
|
|
|
|
else |
|
|
|
|
return !type.Methods.Where(m => m.Name == ".ctor").Any(m => !m.IsPrivate); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
MemberReference IMemberTreeNode.Member |
|
|
|
|
{ |
|
|
|
|
MemberReference IMemberTreeNode.Member { |
|
|
|
|
get { return type; } |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|