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 @@ -13,8 +13,8 @@ namespace ICSharpCode.ILSpy.AddIn.Commands
{
static OpenReferenceCommand instance;
public OpenReferenceCommand(ILSpyAddInPackage owner, uint id)
: base(owner, id)
public OpenReferenceCommand(ILSpyAddInPackage owner)
: base(owner, PkgCmdIDList.cmdidOpenReferenceInILSpy)
{
ThreadHelper.ThrowIfNotOnUIThread();
}
@ -98,11 +98,11 @@ namespace ICSharpCode.ILSpy.AddIn.Commands @@ -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();
instance = new OpenReferenceCommand(owner, id);
instance = new OpenReferenceCommand(owner);
}
}

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

@ -57,26 +57,6 @@ @@ -57,26 +57,6 @@
</Strings>
</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">
<Parent guid="guidILSpyAddInCmdSet" id="OpenILSpyProjGroup" />
<Icon guid="guidImages" id="bmpLogo" />

18
ILSpy.AddIn/ILSpyAddIn.vsct

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

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

@ -57,26 +57,6 @@ @@ -57,26 +57,6 @@
</Strings>
</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">
<Parent guid="guidILSpyAddInCmdSet" id="OpenILSpyProjGroup" />
<Icon guid="guidImages" id="bmpLogo" />

4
ILSpy.AddIn/ILSpyAddInPackage.cs

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

2
ILSpy.AddIn/PkgCmdID.cs

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