From 905927274bb35bca20e9edbd311042e9506e4fec Mon Sep 17 00:00:00 2001 From: Ed Harvey Date: Mon, 11 Apr 2011 09:37:35 +1000 Subject: [PATCH] Added node image for PInvoke methods. --- ILSpy/ILSpy.csproj | 1 + ILSpy/Images/Images.cs | 5 +++++ ILSpy/Images/MemberIcon.cs | 1 + ILSpy/Images/OverlayStatic.png | Bin 312 -> 310 bytes ILSpy/Images/PInvokeMethod.png | Bin 0 -> 630 bytes ILSpy/TreeNodes/MethodTreeNode.cs | 5 ++++- 6 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 ILSpy/Images/PInvokeMethod.png diff --git a/ILSpy/ILSpy.csproj b/ILSpy/ILSpy.csproj index 2b4c2f3ba..a510305de 100644 --- a/ILSpy/ILSpy.csproj +++ b/ILSpy/ILSpy.csproj @@ -246,6 +246,7 @@ + diff --git a/ILSpy/Images/Images.cs b/ILSpy/Images/Images.cs index ec526d543..d84a5412f 100644 --- a/ILSpy/Images/Images.cs +++ b/ILSpy/Images/Images.cs @@ -62,6 +62,7 @@ namespace ICSharpCode.ILSpy private static readonly BitmapImage VirtualMethod = LoadBitmap("VirtualMethod"); private static readonly BitmapImage Operator = LoadBitmap("Operator"); 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 Indexer = LoadBitmap("Indexer"); @@ -159,6 +160,7 @@ namespace ICSharpCode.ILSpy PreloadPublicIconToCache(MemberIcon.VirtualMethod, Images.VirtualMethod); PreloadPublicIconToCache(MemberIcon.Operator, Images.Operator); PreloadPublicIconToCache(MemberIcon.ExtensionMethod, Images.ExtensionMethod); + PreloadPublicIconToCache(MemberIcon.PInvokeMethod, Images.PInvokeMethod); PreloadPublicIconToCache(MemberIcon.Event, Images.Event); } @@ -199,6 +201,9 @@ namespace ICSharpCode.ILSpy case MemberIcon.ExtensionMethod: baseImage = Images.ExtensionMethod; break; + case MemberIcon.PInvokeMethod: + baseImage = Images.PInvokeMethod; + break; case MemberIcon.Event: baseImage = Images.Event; break; diff --git a/ILSpy/Images/MemberIcon.cs b/ILSpy/Images/MemberIcon.cs index 3112a2cc7..3e8bcd80b 100644 --- a/ILSpy/Images/MemberIcon.cs +++ b/ILSpy/Images/MemberIcon.cs @@ -33,6 +33,7 @@ namespace ICSharpCode.ILSpy VirtualMethod, Operator, ExtensionMethod, + PInvokeMethod, Event } } diff --git a/ILSpy/Images/OverlayStatic.png b/ILSpy/Images/OverlayStatic.png index f12f33739ba61954b502b0683126dec9b29c3252..d87bc89289f8bb297967de6fb2ce5c862f69a794 100644 GIT binary patch delta 167 zcmV;Y09gOH0=5E>mw$>$L_t(IPh()92B4 zedCmC|NnPi{{P>9|CfJ?eQVc~WI)ofuQzHh{QqBi{{MfM-5>u8b!~b>k^x@pudR37 z_35AO_7DGM7vBEMS~-0wNd|!YEZ4neJzvL$w=CsTma=42%OH_tz^LNU5E$?f0001D VKK=CVa4rA<002ovPDHLkV1hQRRmcDU delta 169 zcmV;a09OCD0=NQ@mw${&L_t(IPh(&Jg4*LB)#@+&*jRY>+x37A*H_v1tWW}p6AdcP ze&0Cd+W-IEm;e9w-~Z*GV&B^JL~8~qOgi@UM(u_F|4YyR|L?N<amtz-#@r z^^Utf{j=Tv;lJ#{+kaUrr!OVR0Fa;My4S4d>)7y?rF_a#mLiO5Ig$(*RXiF3Lq7xn X|35zcPhd4f00000NkvXXu0mjfKwMk1 diff --git a/ILSpy/Images/PInvokeMethod.png b/ILSpy/Images/PInvokeMethod.png new file mode 100644 index 0000000000000000000000000000000000000000..4b7e9fcc9f5e2f416874196bfc5c9a26ec1da378 GIT binary patch literal 630 zcmV-+0*U>JP)004R=004l4008;_004mL004C`008P>0026e000+nl3&F}00009 za7bBm000tl000tl0bXTW;{X5v7IZ~ebW?9;ba!ELWdLwtX>N2bZe?^JG%heZ==Es; z00GKLL_t(IPnD7DD??!%#}EGs@xmo9h(s=72{YF>6y=57<`#-MqZF-Nrf@LL3pTUa zyf7)ZMC1|~E4kJda%odusIAV|dCnn9?buV_p6A8y^Zk8)zlWmyJXwl6B-ieR`-xFh zvFbe_N9hcZv|SJbB-QMSn-uoCk=OGAY4-y-m{)qU4cW94v1Nr*42$v+ zK?R(tr1b)cm7BbLjuIppW`7C%J44NbA*nR`uQ4tsu1Ze&PT({-L2eG@VNPM9i@es{ z$O+`yaKU5t;zj+6P|iTrWU2ZCf4muCx0_&EGD9_PCbI<+*kN(NWAwtq2znZN=9BFA z97KyI(8=^ztzUy{)(y|(m&v#n56mNmq-tS-r1R6g(0yx%OJH39Gs7pK^tp35t+V}@ zXuWVvxiOkQ21TU8_YV*QL;gHYt8K8?+p*TLjvM9{0~v$RBus&hq<;)ZihG9{u zR~Mks3khbWx|}(g0k)bmoXO8YM=7CA(4s$P0E&oC@dRIEq#9)NIIKM4yN<+-qCKnw z+od}xqD%ZPuoNuDlO)QhF0_QUz*@AN{%`oZaHV)9tueR>I;k$xZ`c>`33!4$emD2b Qvj6}907*qoM6N<$f(U*MaR2}S literal 0 HcmV?d00001 diff --git a/ILSpy/TreeNodes/MethodTreeNode.cs b/ILSpy/TreeNodes/MethodTreeNode.cs index 8a5817ba2..9c8f57f7c 100644 --- a/ILSpy/TreeNodes/MethodTreeNode.cs +++ b/ILSpy/TreeNodes/MethodTreeNode.cs @@ -90,10 +90,13 @@ namespace ICSharpCode.ILSpy.TreeNodes } if (method.IsSpecialName && - (method.Name == ".ctor" || method.Name == ".cctor")) { + (method.Name == ".ctor" || method.Name == ".cctor")) { 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; return Images.GetIcon(