Browse Source

Allow to open ILSpy on project references under "Dependencies"

pull/2454/head
Andreas Weizel 5 years ago
parent
commit
04a615a3f2
  1. 16
      ILSpy.AddIn/Commands/OpenReferenceCommand.cs
  2. 10
      ILSpy.AddIn/ILSpyAddIn.en-US.vsct
  3. 7
      ILSpy.AddIn/ILSpyAddIn.vsct
  4. 10
      ILSpy.AddIn/ILSpyAddIn.zh-Hans.vsct
  5. 1
      ILSpy.AddIn/ILSpyAddInPackage.cs
  6. 1
      ILSpy.AddIn/PkgCmdID.cs

16
ILSpy.AddIn/Commands/OpenReferenceCommand.cs

@ -68,14 +68,6 @@ namespace ICSharpCode.ILSpy.AddIn.Commands
return; return;
} }
// Handle NuGet references
var nugetRefItem = NuGetReferenceForILSpy.Detect(itemObject);
if (nugetRefItem != null)
{
OpenAssembliesInILSpy(nugetRefItem.GetILSpyParameters());
return;
}
// Handle project references // Handle project references
var projectRefItem = ProjectReferenceForILSpy.Detect(itemObject); var projectRefItem = ProjectReferenceForILSpy.Detect(itemObject);
if (projectRefItem != null) if (projectRefItem != null)
@ -96,6 +88,14 @@ namespace ICSharpCode.ILSpy.AddIn.Commands
OpenAssembliesInILSpy(projectRefItem.GetILSpyParameters()); OpenAssembliesInILSpy(projectRefItem.GetILSpyParameters());
return; return;
} }
// Handle NuGet references
var nugetRefItem = NuGetReferenceForILSpy.Detect(itemObject);
if (nugetRefItem != null)
{
OpenAssembliesInILSpy(nugetRefItem.GetILSpyParameters());
return;
}
} }
internal static void Register(ILSpyAddInPackage owner, uint id) internal static void Register(ILSpyAddInPackage owner, uint id)

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

@ -67,6 +67,16 @@
</Strings> </Strings>
</Button> </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" />

7
ILSpy.AddIn/ILSpyAddIn.vsct

@ -56,6 +56,10 @@
<Group guid="guidILSpyAddInCmdSet" id="OpenILSpyPackageRefGroup" priority="0x0200"> <Group guid="guidILSpyAddInCmdSet" id="OpenILSpyPackageRefGroup" priority="0x0200">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PACKAGEREFERENCE"/> <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PACKAGEREFERENCE"/>
</Group> </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.-->
@ -80,11 +84,13 @@
<IDSymbol name="OpenILSpyProjGroup" value="0x1030" /> <IDSymbol name="OpenILSpyProjGroup" value="0x1030" />
<IDSymbol name="OpenILSpyCodeItemGroup" value="0x1040" /> <IDSymbol name="OpenILSpyCodeItemGroup" value="0x1040" />
<IDSymbol name="OpenILSpyPackageRefGroup" value="0x1050" /> <IDSymbol name="OpenILSpyPackageRefGroup" value="0x1050" />
<IDSymbol name="OpenILSpyProjectRefGroup" value="0x1060" />
<IDSymbol name="cmdidOpenILSpy" value="0x0100" /> <IDSymbol name="cmdidOpenILSpy" value="0x0100" />
<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="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}" >
@ -98,6 +104,7 @@
<GuidSymbol name="guidReferenceContext" value="{D309F791-903F-11D0-9EFC-00A0C911004F}"> <GuidSymbol name="guidReferenceContext" value="{D309F791-903F-11D0-9EFC-00A0C911004F}">
<IDSymbol name="IDM_VS_CTXT_PACKAGEREFERENCE" value="0x04A3"/> <IDSymbol name="IDM_VS_CTXT_PACKAGEREFERENCE" value="0x04A3"/>
<IDSymbol name="IDM_VS_CTXT_PROJECTREFERENCE" value="0x04A7"/>
</GuidSymbol> </GuidSymbol>
</Symbols> </Symbols>

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

@ -66,6 +66,16 @@
<ButtonText>用 ILSpy 打开</ButtonText> <ButtonText>用 ILSpy 打开</ButtonText>
</Strings> </Strings>
</Button> </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" />

1
ILSpy.AddIn/ILSpyAddInPackage.cs

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

1
ILSpy.AddIn/PkgCmdID.cs

@ -10,5 +10,6 @@ namespace ICSharpCode.ILSpy.AddIn
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 cmdidOpenPackageReferenceInILSpy = 0x500;
public const uint cmdidOpenProjectReferenceInILSpy = 0x600;
}; };
} }
Loading…
Cancel
Save