Browse Source

Added node image for PInvoke methods.

pull/150/head
Ed Harvey 15 years ago
committed by Daniel Grunwald
parent
commit
905927274b
  1. 1
      ILSpy/ILSpy.csproj
  2. 5
      ILSpy/Images/Images.cs
  3. 1
      ILSpy/Images/MemberIcon.cs
  4. BIN
      ILSpy/Images/OverlayStatic.png
  5. BIN
      ILSpy/Images/PInvokeMethod.png
  6. 5
      ILSpy/TreeNodes/MethodTreeNode.cs

1
ILSpy/ILSpy.csproj

@ -246,6 +246,7 @@
<Resource Include="Images\OverlayProtectedInternal.png" /> <Resource Include="Images\OverlayProtectedInternal.png" />
<Resource Include="Images\OverlayStatic.png" /> <Resource Include="Images\OverlayStatic.png" />
<Resource Include="Images\VirtualMethod.png" /> <Resource Include="Images\VirtualMethod.png" />
<Resource Include="Images\PInvokeMethod.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj"> <ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj">

5
ILSpy/Images/Images.cs

@ -62,6 +62,7 @@ namespace ICSharpCode.ILSpy
private static readonly BitmapImage VirtualMethod = LoadBitmap("VirtualMethod"); private static readonly BitmapImage VirtualMethod = LoadBitmap("VirtualMethod");
private static readonly BitmapImage Operator = LoadBitmap("Operator"); private static readonly BitmapImage Operator = LoadBitmap("Operator");
private static readonly BitmapImage ExtensionMethod = LoadBitmap("ExtensionMethod"); private static readonly BitmapImage ExtensionMethod = LoadBitmap("ExtensionMethod");
private static readonly BitmapImage PInvokeMethod = LoadBitmap("PInvokeMethod");
private static readonly BitmapImage Property = LoadBitmap("Property"); private static readonly BitmapImage Property = LoadBitmap("Property");
private static readonly BitmapImage Indexer = LoadBitmap("Indexer"); private static readonly BitmapImage Indexer = LoadBitmap("Indexer");
@ -159,6 +160,7 @@ namespace ICSharpCode.ILSpy
PreloadPublicIconToCache(MemberIcon.VirtualMethod, Images.VirtualMethod); PreloadPublicIconToCache(MemberIcon.VirtualMethod, Images.VirtualMethod);
PreloadPublicIconToCache(MemberIcon.Operator, Images.Operator); PreloadPublicIconToCache(MemberIcon.Operator, Images.Operator);
PreloadPublicIconToCache(MemberIcon.ExtensionMethod, Images.ExtensionMethod); PreloadPublicIconToCache(MemberIcon.ExtensionMethod, Images.ExtensionMethod);
PreloadPublicIconToCache(MemberIcon.PInvokeMethod, Images.PInvokeMethod);
PreloadPublicIconToCache(MemberIcon.Event, Images.Event); PreloadPublicIconToCache(MemberIcon.Event, Images.Event);
} }
@ -199,6 +201,9 @@ namespace ICSharpCode.ILSpy
case MemberIcon.ExtensionMethod: case MemberIcon.ExtensionMethod:
baseImage = Images.ExtensionMethod; baseImage = Images.ExtensionMethod;
break; break;
case MemberIcon.PInvokeMethod:
baseImage = Images.PInvokeMethod;
break;
case MemberIcon.Event: case MemberIcon.Event:
baseImage = Images.Event; baseImage = Images.Event;
break; break;

1
ILSpy/Images/MemberIcon.cs

@ -33,6 +33,7 @@ namespace ICSharpCode.ILSpy
VirtualMethod, VirtualMethod,
Operator, Operator,
ExtensionMethod, ExtensionMethod,
PInvokeMethod,
Event Event
} }
} }

BIN
ILSpy/Images/OverlayStatic.png

Before

Width: 16  |  Height: 16  |  Size: 312 B

After

Width: 16  |  Height: 16  |  Size: 310 B

BIN
ILSpy/Images/PInvokeMethod.png

After

Width: 16  |  Height: 16  |  Size: 630 B

5
ILSpy/TreeNodes/MethodTreeNode.cs

@ -90,10 +90,13 @@ namespace ICSharpCode.ILSpy.TreeNodes
} }
if (method.IsSpecialName && if (method.IsSpecialName &&
(method.Name == ".ctor" || method.Name == ".cctor")) {
(method.Name == ".ctor" || method.Name == ".cctor")) {
return Images.GetIcon(MemberIcon.Constructor, GetOverlayIcon(method.Attributes), false); return Images.GetIcon(MemberIcon.Constructor, GetOverlayIcon(method.Attributes), false);
} }
if (method.HasPInvokeInfo)
return Images.GetIcon(MemberIcon.PInvokeMethod, GetOverlayIcon(method.Attributes), true);
bool showAsVirtual = method.IsVirtual && !(method.IsNewSlot && method.IsFinal) && !method.DeclaringType.IsInterface; bool showAsVirtual = method.IsVirtual && !(method.IsNewSlot && method.IsFinal) && !method.DeclaringType.IsInterface;
return Images.GetIcon( return Images.GetIcon(

Loading…
Cancel
Save