Browse Source

Combine all "Open reference" commands to avoid duplicate code

pull/2454/head
Andreas Weizel 4 years ago
parent
commit
79bc9de904
  1. 8
      ILSpy.AddIn/Commands/OpenReferenceCommand.cs
  2. 20
      ILSpy.AddIn/ILSpyAddIn.en-US.vsct
  3. 18
      ILSpy.AddIn/ILSpyAddIn.vsct
  4. 20
      ILSpy.AddIn/ILSpyAddIn.zh-Hans.vsct
  5. 4
      ILSpy.AddIn/ILSpyAddInPackage.cs
  6. 2
      ILSpy.AddIn/PkgCmdID.cs

8
ILSpy.AddIn/Commands/OpenReferenceCommand.cs

@ -13,8 +13,8 @@ namespace ICSharpCode.ILSpy.AddIn.Commands
{ {
static OpenReferenceCommand instance; static OpenReferenceCommand instance;
public OpenReferenceCommand(ILSpyAddInPackage owner, uint id) public OpenReferenceCommand(ILSpyAddInPackage owner)
: base(owner, id) : base(owner, PkgCmdIDList.cmdidOpenReferenceInILSpy)
{ {
ThreadHelper.ThrowIfNotOnUIThread(); ThreadHelper.ThrowIfNotOnUIThread();
} }
@ -98,11 +98,11 @@ namespace ICSharpCode.ILSpy.AddIn.Commands
} }
} }
internal static void Register(ILSpyAddInPackage owner, uint id) internal static void Register(ILSpyAddInPackage owner)
{ {
ThreadHelper.ThrowIfNotOnUIThread(); ThreadHelper.ThrowIfNotOnUIThread();
instance = new OpenReferenceCommand(owner, id); instance = new OpenReferenceCommand(owner);
} }
} }

20
ILSpy.AddIn/ILSpyAddIn.en-US.vsct

@ -57,26 +57,6 @@
</Strings> </Strings>
</Button> </Button>
<Button guid="guidILSpyAddInCmdSet" id="cmdidOpenPackageReferenceInILSpy" priority="0x0600" type="Button">
<Parent guid="guidILSpyAddInCmdSet" id="OpenILSpyPackageRefGroup" />
<Icon guid="guidImages" id="bmpLogo" />
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>Open in ILSpy</ButtonText>
</Strings>
</Button>
<Button guid="guidILSpyAddInCmdSet" id="cmdidOpenProjectReferenceInILSpy" priority="0x0600" type="Button">
<Parent guid="guidILSpyAddInCmdSet" id="OpenILSpyProjectRefGroup" />
<Icon guid="guidImages" id="bmpLogo" />
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>Open in ILSpy</ButtonText>
</Strings>
</Button>
<Button guid="guidILSpyAddInCmdSet" id="cmdidOpenProjectOutputInILSpy" priority="0x0600" type="Button"> <Button guid="guidILSpyAddInCmdSet" id="cmdidOpenProjectOutputInILSpy" priority="0x0600" type="Button">
<Parent guid="guidILSpyAddInCmdSet" id="OpenILSpyProjGroup" /> <Parent guid="guidILSpyAddInCmdSet" id="OpenILSpyProjGroup" />
<Icon guid="guidImages" id="bmpLogo" /> <Icon guid="guidImages" id="bmpLogo" />

18
ILSpy.AddIn/ILSpyAddIn.vsct

@ -52,14 +52,6 @@
<Group guid="guidILSpyAddInCmdSet" id="OpenILSpyRefGroup" priority="0x0200"> <Group guid="guidILSpyAddInCmdSet" id="OpenILSpyRefGroup" priority="0x0200">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_REFERENCE"/> <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_REFERENCE"/>
</Group> </Group>
<Group guid="guidILSpyAddInCmdSet" id="OpenILSpyPackageRefGroup" priority="0x0200">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PACKAGEREFERENCE"/>
</Group>
<Group guid="guidILSpyAddInCmdSet" id="OpenILSpyProjectRefGroup" priority="0x0200">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PROJECTREFERENCE"/>
</Group>
</Groups> </Groups>
<!--The bitmaps section is used to define the bitmaps that are used for the commands.--> <!--The bitmaps section is used to define the bitmaps that are used for the commands.-->
@ -72,6 +64,14 @@
<Bitmap guid="guidImages" href="Resources\Images.png" usedList="bmpLogo, bmpPic1, bmpPic2, bmpPicX, bmpPicArrows"/> <Bitmap guid="guidImages" href="Resources\Images.png" usedList="bmpLogo, bmpPic1, bmpPic2, bmpPicX, bmpPicArrows"/>
</Bitmaps> </Bitmaps>
</Commands> </Commands>
<CommandPlacements>
<CommandPlacement guid="guidILSpyAddInCmdSet" id="OpenILSpyRefGroup" priority="0x0200">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PACKAGEREFERENCE"/>
</CommandPlacement>
<CommandPlacement guid="guidILSpyAddInCmdSet" id="OpenILSpyRefGroup" priority="0x0200">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PROJECTREFERENCE"/>
</CommandPlacement>
</CommandPlacements>
<Symbols> <Symbols>
<!-- This is the package guid. --> <!-- This is the package guid. -->
<GuidSymbol name="guidILSpyAddInPkg" value="{a9120dbe-164a-4891-842f-fb7829273838}" /> <GuidSymbol name="guidILSpyAddInPkg" value="{a9120dbe-164a-4891-842f-fb7829273838}" />
@ -89,8 +89,6 @@
<IDSymbol name="cmdidOpenReferenceInILSpy" value="0x0200" /> <IDSymbol name="cmdidOpenReferenceInILSpy" value="0x0200" />
<IDSymbol name="cmdidOpenProjectOutputInILSpy" value="0x0300" /> <IDSymbol name="cmdidOpenProjectOutputInILSpy" value="0x0300" />
<IDSymbol name="cmdidOpenCodeItemInILSpy" value="0x0400" /> <IDSymbol name="cmdidOpenCodeItemInILSpy" value="0x0400" />
<IDSymbol name="cmdidOpenPackageReferenceInILSpy" value="0x0500" />
<IDSymbol name="cmdidOpenProjectReferenceInILSpy" value="0x0600" />
</GuidSymbol> </GuidSymbol>
<GuidSymbol name="guidImages" value="{2f654db9-4641-4638-9937-27c6202b2a6a}" > <GuidSymbol name="guidImages" value="{2f654db9-4641-4638-9937-27c6202b2a6a}" >

20
ILSpy.AddIn/ILSpyAddIn.zh-Hans.vsct

@ -57,26 +57,6 @@
</Strings> </Strings>
</Button> </Button>
<Button guid="guidILSpyAddInCmdSet" id="cmdidOpenPackageReferenceInILSpy" priority="0x0600" type="Button">
<Parent guid="guidILSpyAddInCmdSet" id="OpenILSpyPackageRefGroup" />
<Icon guid="guidImages" id="bmpLogo" />
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>用 ILSpy 打开</ButtonText>
</Strings>
</Button>
<Button guid="guidILSpyAddInCmdSet" id="cmdidOpenProjectReferenceInILSpy" priority="0x0600" type="Button">
<Parent guid="guidILSpyAddInCmdSet" id="OpenILSpyProjectRefGroup" />
<Icon guid="guidImages" id="bmpLogo" />
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<Strings>
<ButtonText>用 ILSpy 打开</ButtonText>
</Strings>
</Button>
<Button guid="guidILSpyAddInCmdSet" id="cmdidOpenProjectOutputInILSpy" priority="0x0600" type="Button"> <Button guid="guidILSpyAddInCmdSet" id="cmdidOpenProjectOutputInILSpy" priority="0x0600" type="Button">
<Parent guid="guidILSpyAddInCmdSet" id="OpenILSpyProjGroup" /> <Parent guid="guidILSpyAddInCmdSet" id="OpenILSpyProjGroup" />
<Icon guid="guidImages" id="bmpLogo" /> <Icon guid="guidImages" id="bmpLogo" />

4
ILSpy.AddIn/ILSpyAddInPackage.cs

@ -94,9 +94,7 @@ namespace ICSharpCode.ILSpy.AddIn
OpenILSpyCommand.Register(this); OpenILSpyCommand.Register(this);
OpenProjectOutputCommand.Register(this); OpenProjectOutputCommand.Register(this);
OpenReferenceCommand.Register(this, PkgCmdIDList.cmdidOpenReferenceInILSpy); OpenReferenceCommand.Register(this);
OpenReferenceCommand.Register(this, PkgCmdIDList.cmdidOpenPackageReferenceInILSpy);
OpenReferenceCommand.Register(this, PkgCmdIDList.cmdidOpenProjectReferenceInILSpy);
OpenCodeItemCommand.Register(this); OpenCodeItemCommand.Register(this);
} }
#endregion #endregion

2
ILSpy.AddIn/PkgCmdID.cs

@ -9,7 +9,5 @@ namespace ICSharpCode.ILSpy.AddIn
public const uint cmdidOpenReferenceInILSpy = 0x200; public const uint cmdidOpenReferenceInILSpy = 0x200;
public const uint cmdidOpenProjectOutputInILSpy = 0x300; public const uint cmdidOpenProjectOutputInILSpy = 0x300;
public const uint cmdidOpenCodeItemInILSpy = 0x0400; public const uint cmdidOpenCodeItemInILSpy = 0x0400;
public const uint cmdidOpenPackageReferenceInILSpy = 0x500;
public const uint cmdidOpenProjectReferenceInILSpy = 0x600;
}; };
} }
Loading…
Cancel
Save