mirror of https://github.com/icsharpcode/ILSpy.git
18 changed files with 1027 additions and 0 deletions
@ -0,0 +1,11 @@ |
|||||||
|
// This file is used by Code Analysis to maintain SuppressMessage
|
||||||
|
// attributes that are applied to this project. Project-level
|
||||||
|
// suppressions either have no target or are given a specific target
|
||||||
|
// and scoped to a namespace, type, member, etc.
|
||||||
|
//
|
||||||
|
// To add a suppression to this file, right-click the message in the
|
||||||
|
// Error List, point to "Suppress Message(s)", and click "In Project
|
||||||
|
// Suppression File". You do not need to add suppressions to this
|
||||||
|
// file manually.
|
||||||
|
|
||||||
|
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1017:MarkAssembliesWithComVisible")] |
@ -0,0 +1,14 @@ |
|||||||
|
// Guids.cs
|
||||||
|
// MUST match guids.h
|
||||||
|
using System; |
||||||
|
|
||||||
|
namespace ICSharpCode.ILSpy.AddIn |
||||||
|
{ |
||||||
|
static class GuidList |
||||||
|
{ |
||||||
|
public const string guidILSpyAddInPkgString = "a9120dbe-164a-4891-842f-fb7829273838"; |
||||||
|
public const string guidILSpyAddInCmdSetString = "85ddb8ca-a842-4b1c-ba1a-94141fdf19d0"; |
||||||
|
|
||||||
|
public static readonly Guid guidILSpyAddInCmdSet = new Guid(guidILSpyAddInCmdSetString); |
||||||
|
}; |
||||||
|
} |
After Width: | Height: | Size: 58 KiB |
@ -0,0 +1,198 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0"> |
||||||
|
<PropertyGroup> |
||||||
|
<MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion> |
||||||
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion> |
||||||
|
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> |
||||||
|
</PropertyGroup> |
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> |
||||||
|
<PropertyGroup> |
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||||
|
<SchemaVersion>2.0</SchemaVersion> |
||||||
|
<ProjectGuid>{9D7BE6C0-B7B3-4A50-A54E-18A2D84A3384}</ProjectGuid> |
||||||
|
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> |
||||||
|
<OutputType>Library</OutputType> |
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder> |
||||||
|
<RootNamespace>ICSharpCode.ILSpy.AddIn</RootNamespace> |
||||||
|
<AssemblyName>ILSpy.AddIn</AssemblyName> |
||||||
|
<SignAssembly>True</SignAssembly> |
||||||
|
<AssemblyOriginatorKeyFile>Key.snk</AssemblyOriginatorKeyFile> |
||||||
|
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
||||||
|
<DebugSymbols>true</DebugSymbols> |
||||||
|
<DebugType>full</DebugType> |
||||||
|
<Optimize>false</Optimize> |
||||||
|
<OutputPath>bin\Debug\</OutputPath> |
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||||
|
<ErrorReport>prompt</ErrorReport> |
||||||
|
<WarningLevel>4</WarningLevel> |
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
||||||
|
</PropertyGroup> |
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> |
||||||
|
<DebugType>pdbonly</DebugType> |
||||||
|
<Optimize>true</Optimize> |
||||||
|
<OutputPath>bin\Release\</OutputPath> |
||||||
|
<DefineConstants>TRACE</DefineConstants> |
||||||
|
<ErrorReport>prompt</ErrorReport> |
||||||
|
<WarningLevel>4</WarningLevel> |
||||||
|
<RunCodeAnalysis>true</RunCodeAnalysis> |
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
||||||
|
</PropertyGroup> |
||||||
|
<ItemGroup> |
||||||
|
<Reference Include="Microsoft.CSharp" /> |
||||||
|
<Reference Include="Microsoft.VisualStudio.Designer.Interfaces, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> |
||||||
|
<EmbedInteropTypes>True</EmbedInteropTypes> |
||||||
|
</Reference> |
||||||
|
<Reference Include="Microsoft.VisualStudio.OLE.Interop" /> |
||||||
|
<Reference Include="Microsoft.VisualStudio.Shell.Interop" /> |
||||||
|
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0" /> |
||||||
|
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0" /> |
||||||
|
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0" /> |
||||||
|
<Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0"> |
||||||
|
<EmbedInteropTypes>true</EmbedInteropTypes> |
||||||
|
</Reference> |
||||||
|
<Reference Include="Microsoft.VisualStudio.Shell.Interop.12.0"> |
||||||
|
<EmbedInteropTypes>true</EmbedInteropTypes> |
||||||
|
</Reference> |
||||||
|
<Reference Include="Microsoft.VisualStudio.TextManager.Interop" /> |
||||||
|
<Reference Include="Microsoft.VisualStudio.Shell.12.0" /> |
||||||
|
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.10.0" /> |
||||||
|
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.11.0" /> |
||||||
|
<Reference Include="Microsoft.VisualStudio.Shell.Immutable.12.0" /> |
||||||
|
<Reference Include="System" /> |
||||||
|
<Reference Include="System.Core" /> |
||||||
|
<Reference Include="System.Data" /> |
||||||
|
<Reference Include="System.Design" /> |
||||||
|
<Reference Include="System.Drawing" /> |
||||||
|
<Reference Include="System.Windows.Forms" /> |
||||||
|
<Reference Include="System.Xml" /> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<COMReference Include="EnvDTE"> |
||||||
|
<Guid>{80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}</Guid> |
||||||
|
<VersionMajor>8</VersionMajor> |
||||||
|
<VersionMinor>0</VersionMinor> |
||||||
|
<Lcid>0</Lcid> |
||||||
|
<WrapperTool>primary</WrapperTool> |
||||||
|
<Isolated>False</Isolated> |
||||||
|
<EmbedInteropTypes>False</EmbedInteropTypes> |
||||||
|
</COMReference> |
||||||
|
<COMReference Include="EnvDTE100"> |
||||||
|
<Guid>{26AD1324-4B7C-44BC-84F8-B86AED45729F}</Guid> |
||||||
|
<VersionMajor>10</VersionMajor> |
||||||
|
<VersionMinor>0</VersionMinor> |
||||||
|
<Lcid>0</Lcid> |
||||||
|
<WrapperTool>primary</WrapperTool> |
||||||
|
<Isolated>False</Isolated> |
||||||
|
<EmbedInteropTypes>False</EmbedInteropTypes> |
||||||
|
</COMReference> |
||||||
|
<COMReference Include="EnvDTE80"> |
||||||
|
<Guid>{1A31287A-4D7D-413E-8E32-3B374931BD89}</Guid> |
||||||
|
<VersionMajor>8</VersionMajor> |
||||||
|
<VersionMinor>0</VersionMinor> |
||||||
|
<Lcid>0</Lcid> |
||||||
|
<WrapperTool>primary</WrapperTool> |
||||||
|
<Isolated>False</Isolated> |
||||||
|
<EmbedInteropTypes>False</EmbedInteropTypes> |
||||||
|
</COMReference> |
||||||
|
<COMReference Include="EnvDTE90"> |
||||||
|
<Guid>{2CE2370E-D744-4936-A090-3FFFE667B0E1}</Guid> |
||||||
|
<VersionMajor>9</VersionMajor> |
||||||
|
<VersionMinor>0</VersionMinor> |
||||||
|
<Lcid>0</Lcid> |
||||||
|
<WrapperTool>primary</WrapperTool> |
||||||
|
<Isolated>False</Isolated> |
||||||
|
<EmbedInteropTypes>False</EmbedInteropTypes> |
||||||
|
</COMReference> |
||||||
|
<COMReference Include="Microsoft.VisualStudio.CommandBars"> |
||||||
|
<Guid>{1CBA492E-7263-47BB-87FE-639000619B15}</Guid> |
||||||
|
<VersionMajor>8</VersionMajor> |
||||||
|
<VersionMinor>0</VersionMinor> |
||||||
|
<Lcid>0</Lcid> |
||||||
|
<WrapperTool>primary</WrapperTool> |
||||||
|
<Isolated>False</Isolated> |
||||||
|
<EmbedInteropTypes>False</EmbedInteropTypes> |
||||||
|
</COMReference> |
||||||
|
<COMReference Include="stdole"> |
||||||
|
<Guid>{00020430-0000-0000-C000-000000000046}</Guid> |
||||||
|
<VersionMajor>2</VersionMajor> |
||||||
|
<VersionMinor>0</VersionMinor> |
||||||
|
<Lcid>0</Lcid> |
||||||
|
<WrapperTool>primary</WrapperTool> |
||||||
|
<Isolated>False</Isolated> |
||||||
|
<EmbedInteropTypes>False</EmbedInteropTypes> |
||||||
|
</COMReference> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<Compile Include="Guids.cs" /> |
||||||
|
<Compile Include="Resources.Designer.cs"> |
||||||
|
<AutoGen>True</AutoGen> |
||||||
|
<DesignTime>True</DesignTime> |
||||||
|
<DependentUpon>Resources.resx</DependentUpon> |
||||||
|
</Compile> |
||||||
|
<Compile Include="GlobalSuppressions.cs" /> |
||||||
|
<Compile Include="ILSpyAddInPackage.cs" /> |
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" /> |
||||||
|
<Compile Include="PkgCmdID.cs" /> |
||||||
|
<Compile Include="Utils.cs" /> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<EmbeddedResource Include="Resources.resx"> |
||||||
|
<Generator>ResXFileCodeGenerator</Generator> |
||||||
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput> |
||||||
|
<SubType>Designer</SubType> |
||||||
|
</EmbeddedResource> |
||||||
|
<EmbeddedResource Include="VSPackage.resx"> |
||||||
|
<MergeWithCTO>true</MergeWithCTO> |
||||||
|
<ManifestResourceName>VSPackage</ManifestResourceName> |
||||||
|
</EmbeddedResource> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<None Include="source.extension.vsixmanifest"> |
||||||
|
<SubType>Designer</SubType> |
||||||
|
</None> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<None Include="Key.snk" /> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<VSCTCompile Include="ILSpyAddIn.vsct"> |
||||||
|
<ResourceName>Menus.ctmenu</ResourceName> |
||||||
|
<SubType>Designer</SubType> |
||||||
|
</VSCTCompile> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<None Include="Resources\Images.png" /> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<Content Include="ILSpy-Large.ico"> |
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||||
|
<IncludeInVSIX>true</IncludeInVSIX> |
||||||
|
</Content> |
||||||
|
<Content Include="license.txt"> |
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||||
|
<IncludeInVSIX>true</IncludeInVSIX> |
||||||
|
</Content> |
||||||
|
<Content Include="Resources\Package.ico" /> |
||||||
|
</ItemGroup> |
||||||
|
<ItemGroup> |
||||||
|
<ProjectReference Include="..\ILSpy\ILSpy.csproj"> |
||||||
|
<Project>{1e85eff9-e370-4683-83e4-8a3d063ff791}</Project> |
||||||
|
<Name>ILSpy</Name> |
||||||
|
</ProjectReference> |
||||||
|
</ItemGroup> |
||||||
|
<PropertyGroup> |
||||||
|
<UseCodebase>true</UseCodebase> |
||||||
|
</PropertyGroup> |
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> |
||||||
|
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" /> |
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
||||||
|
Other similar extension points exist, see Microsoft.Common.targets. |
||||||
|
<Target Name="BeforeBuild"> |
||||||
|
</Target> |
||||||
|
<Target Name="AfterBuild"> |
||||||
|
</Target> |
||||||
|
--> |
||||||
|
</Project> |
@ -0,0 +1,115 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
||||||
|
|
||||||
|
<!-- This is the file that defines the actual layout and type of the commands. |
||||||
|
It is divided in different sections (e.g. command definition, command |
||||||
|
placement, ...), with each defining a specific set of properties. |
||||||
|
See the comment before each section for more details about how to |
||||||
|
use it. --> |
||||||
|
|
||||||
|
<!-- The VSCT compiler (the tool that translates this file into the binary |
||||||
|
format that VisualStudio will consume) has the ability to run a preprocessor |
||||||
|
on the vsct file; this preprocessor is (usually) the C++ preprocessor, so |
||||||
|
it is possible to define includes and macros with the same syntax used |
||||||
|
in C++ files. Using this ability of the compiler here, we include some files |
||||||
|
defining some of the constants that we will use inside the file. --> |
||||||
|
|
||||||
|
<!--This is the file that defines the IDs for all the commands exposed by VisualStudio. --> |
||||||
|
<Extern href="stdidcmd.h"/> |
||||||
|
|
||||||
|
<!--This header contains the command ids for the menus provided by the shell. --> |
||||||
|
<Extern href="vsshlids.h"/> |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--The Commands section is where we the commands, menus and menu groups are defined. |
||||||
|
This section uses a Guid to identify the package that provides the command defined inside it. --> |
||||||
|
<Commands package="guidILSpyAddInPkg"> |
||||||
|
<!-- Inside this section we have different sub-sections: one for the menus, another |
||||||
|
for the menu groups, one for the buttons (the actual commands), one for the combos |
||||||
|
and the last one for the bitmaps used. Each element is identified by a command id that |
||||||
|
is a unique pair of guid and numeric identifier; the guid part of the identifier is usually |
||||||
|
called "command set" and is used to group different command inside a logically related |
||||||
|
group; your package should define its own command set in order to avoid collisions |
||||||
|
with command ids defined by other packages. --> |
||||||
|
|
||||||
|
|
||||||
|
<!-- In this section you can define new menu groups. A menu group is a container for |
||||||
|
other menus or buttons (commands); from a visual point of view you can see the |
||||||
|
group as the part of a menu contained between two lines. The parent of a group |
||||||
|
must be a menu. --> |
||||||
|
<Groups> |
||||||
|
<Group guid="guidILSpyAddInCmdSet" id="ILSpyAddInGroup" priority="0x0200"> |
||||||
|
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_REFERENCE"/> |
||||||
|
</Group> |
||||||
|
|
||||||
|
<Group guid="guidILSpyAddInCmdSet" id="OpenILSpyGroup" priority="0x0200"> |
||||||
|
<Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS"/> |
||||||
|
</Group> |
||||||
|
</Groups> |
||||||
|
|
||||||
|
<!--Buttons section. --> |
||||||
|
<!--This section defines the elements the user can interact with, like a menu command or a button |
||||||
|
or combo box in a toolbar. --> |
||||||
|
<Buttons> |
||||||
|
<!--To define a menu group you have to specify its ID, the parent menu and its display priority. |
||||||
|
The command is visible and enabled by default. If you need to change the visibility, status, etc, you can use |
||||||
|
the CommandFlag node. |
||||||
|
You can add more than one CommandFlag node e.g.: |
||||||
|
<CommandFlag>DefaultInvisible</CommandFlag> |
||||||
|
<CommandFlag>DynamicVisibility</CommandFlag> |
||||||
|
If you do not want an image next to your command, remove the Icon node /> --> |
||||||
|
|
||||||
|
<Button guid="guidILSpyAddInCmdSet" id="cmdidOpenInILSpy" priority="0x0600" type="Button"> |
||||||
|
<Parent guid="guidILSpyAddInCmdSet" id="ILSpyAddInGroup" /> |
||||||
|
<Icon guid="guidImages" id="bmpPicSearch" /> |
||||||
|
<Strings> |
||||||
|
<ButtonText>Open in ILSpy</ButtonText> |
||||||
|
</Strings> |
||||||
|
</Button> |
||||||
|
|
||||||
|
<Button guid="guidILSpyAddInCmdSet" id="cmdidOpenILSpy" priority="0x0600" type="Button"> |
||||||
|
<Parent guid="guidILSpyAddInCmdSet" id="OpenILSpyGroup" /> |
||||||
|
<Strings> |
||||||
|
<ButtonText>ILSpy</ButtonText> |
||||||
|
</Strings> |
||||||
|
</Button> |
||||||
|
|
||||||
|
</Buttons> |
||||||
|
|
||||||
|
<!--The bitmaps section is used to define the bitmaps that are used for the commands.--> |
||||||
|
<Bitmaps> |
||||||
|
<!-- The bitmap id is defined in a way that is a little bit different from the others: |
||||||
|
the declaration starts with a guid for the bitmap strip, then there is the resource id of the |
||||||
|
bitmap strip containing the bitmaps and then there are the numeric ids of the elements used |
||||||
|
inside a button definition. An important aspect of this declaration is that the element id |
||||||
|
must be the actual index (1-based) of the bitmap inside the bitmap strip. --> |
||||||
|
<Bitmap guid="guidImages" href="Resources\Images.png" usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows"/> |
||||||
|
</Bitmaps> |
||||||
|
</Commands> |
||||||
|
|
||||||
|
<Symbols> |
||||||
|
<!-- This is the package guid. --> |
||||||
|
<GuidSymbol name="guidILSpyAddInPkg" value="{a9120dbe-164a-4891-842f-fb7829273838}" /> |
||||||
|
|
||||||
|
<!-- This is the guid used to group the menu commands together --> |
||||||
|
<GuidSymbol name="guidILSpyAddInCmdSet" value="{85ddb8ca-a842-4b1c-ba1a-94141fdf19d0}"> |
||||||
|
|
||||||
|
<IDSymbol name="ILSpyAddInGroup" value="0x1020" /> |
||||||
|
<IDSymbol name="OpenILSpyGroup" value="0x1030" /> |
||||||
|
<IDSymbol name="cmdidOpenILSpy" value="0x0100" /> |
||||||
|
<IDSymbol name="cmdidOpenInILSpy" value="0x0200" /> |
||||||
|
</GuidSymbol> |
||||||
|
|
||||||
|
<GuidSymbol name="guidImages" value="{2f654db9-4641-4638-9937-27c6202b2a6a}" > |
||||||
|
<IDSymbol name="bmpPic1" value="1" /> |
||||||
|
<IDSymbol name="bmpPic2" value="2" /> |
||||||
|
<IDSymbol name="bmpPicSearch" value="3" /> |
||||||
|
<IDSymbol name="bmpPicX" value="4" /> |
||||||
|
<IDSymbol name="bmpPicArrows" value="5" /> |
||||||
|
<IDSymbol name="bmpPicStrikethrough" value="6" /> |
||||||
|
</GuidSymbol> |
||||||
|
</Symbols> |
||||||
|
|
||||||
|
</CommandTable> |
@ -0,0 +1,143 @@ |
|||||||
|
using System; |
||||||
|
using System.Diagnostics; |
||||||
|
using System.Globalization; |
||||||
|
using System.Runtime.InteropServices; |
||||||
|
using System.ComponentModel.Design; |
||||||
|
using Microsoft.Win32; |
||||||
|
using Microsoft.VisualStudio; |
||||||
|
using Microsoft.VisualStudio.Shell.Interop; |
||||||
|
using Microsoft.VisualStudio.OLE.Interop; |
||||||
|
using Microsoft.VisualStudio.Shell; |
||||||
|
using System.Reflection; |
||||||
|
using System.IO; |
||||||
|
|
||||||
|
namespace ICSharpCode.ILSpy.AddIn |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// This is the class that implements the package exposed by this assembly.
|
||||||
|
///
|
||||||
|
/// The minimum requirement for a class to be considered a valid package for Visual Studio
|
||||||
|
/// is to implement the IVsPackage interface and register itself with the shell.
|
||||||
|
/// This package uses the helper classes defined inside the Managed Package Framework (MPF)
|
||||||
|
/// to do it: it derives from the Package class that provides the implementation of the
|
||||||
|
/// IVsPackage interface and uses the registration attributes defined in the framework to
|
||||||
|
/// register itself and its components with the shell.
|
||||||
|
/// </summary>
|
||||||
|
// This attribute tells the PkgDef creation utility (CreatePkgDef.exe) that this class is
|
||||||
|
// a package.
|
||||||
|
[PackageRegistration(UseManagedResourcesOnly = true)] |
||||||
|
// This attribute is used to register the information needed to show this package
|
||||||
|
// in the Help/About dialog of Visual Studio.
|
||||||
|
[InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] |
||||||
|
// This attribute is needed to let the shell know that this package exposes some menus.
|
||||||
|
[ProvideMenuResource("Menus.ctmenu", 1)] |
||||||
|
[Guid(GuidList.guidILSpyAddInPkgString)] |
||||||
|
[ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_string)] |
||||||
|
public sealed class ILSpyAddInPackage : Package |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Default constructor of the package.
|
||||||
|
/// Inside this method you can place any initialization code that does not require
|
||||||
|
/// any Visual Studio service because at this point the package object is created but
|
||||||
|
/// not sited yet inside Visual Studio environment. The place to do all the other
|
||||||
|
/// initialization is the Initialize method.
|
||||||
|
/// </summary>
|
||||||
|
public ILSpyAddInPackage() |
||||||
|
{ |
||||||
|
Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering constructor for: {0}", this.ToString())); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Overridden Package Implementation
|
||||||
|
#region Package Members
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initialization of the package; this method is called right after the package is sited, so this is the place
|
||||||
|
/// where you can put all the initialization code that rely on services provided by VisualStudio.
|
||||||
|
/// </summary>
|
||||||
|
protected override void Initialize() |
||||||
|
{ |
||||||
|
Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString())); |
||||||
|
base.Initialize(); |
||||||
|
|
||||||
|
// Add our command handlers for menu (commands must exist in the .vsct file)
|
||||||
|
OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; |
||||||
|
if (null != mcs) |
||||||
|
{ |
||||||
|
// Create the command for the menu item.
|
||||||
|
CommandID menuCommandID = new CommandID(GuidList.guidILSpyAddInCmdSet, (int)PkgCmdIDList.cmdidOpenInILSpy); |
||||||
|
MenuCommand menuItem = new MenuCommand(OpenInILSpyCallback, menuCommandID); |
||||||
|
mcs.AddCommand(menuItem); |
||||||
|
|
||||||
|
// Create the command for the menu item.
|
||||||
|
CommandID menuCommandID2 = new CommandID(GuidList.guidILSpyAddInCmdSet, (int)PkgCmdIDList.cmdidOpenILSpy); |
||||||
|
MenuCommand menuItem2 = new MenuCommand(OpenILSpyCallback, menuCommandID2); |
||||||
|
mcs.AddCommand(menuItem2); |
||||||
|
} |
||||||
|
} |
||||||
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This function is the callback used to execute a command when the a menu item is clicked.
|
||||||
|
/// See the Initialize method to see how the menu item is associated to this function using
|
||||||
|
/// the OleMenuCommandService service and the MenuCommand class.
|
||||||
|
/// </summary>
|
||||||
|
private void OpenInILSpyCallback(object sender, EventArgs e) |
||||||
|
{ |
||||||
|
var explorer = ((EnvDTE80.DTE2)GetGlobalService(typeof(EnvDTE.DTE))).ToolWindows.SolutionExplorer; |
||||||
|
var items = explorer.SelectedItems as EnvDTE.UIHierarchyItem[]; |
||||||
|
|
||||||
|
foreach (var item in items) |
||||||
|
{ |
||||||
|
dynamic obj = item.Object; |
||||||
|
OpenAssemblyInILSpy(obj.Path); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
private void OpenILSpyCallback(object sender, EventArgs e) |
||||||
|
{ |
||||||
|
Process.Start(GetILSpyPath()); |
||||||
|
} |
||||||
|
|
||||||
|
private string GetILSpyPath() |
||||||
|
{ |
||||||
|
var basePath = Path.GetDirectoryName(typeof(ILSpyAddInPackage).Assembly.Location); |
||||||
|
return Path.Combine(basePath, "ILSpy.exe"); |
||||||
|
} |
||||||
|
|
||||||
|
private void OpenAssemblyInILSpy(string assemblyFileName) |
||||||
|
{ |
||||||
|
if (!File.Exists(assemblyFileName)) |
||||||
|
{ |
||||||
|
ShowMessage("Could not find assembly '{0}', please ensure the project and all references were built correctly!", assemblyFileName); |
||||||
|
return; |
||||||
|
} |
||||||
|
Process.Start(GetILSpyPath(), Utils.ArgumentArrayToCommandLine(assemblyFileName)); |
||||||
|
} |
||||||
|
|
||||||
|
private void ShowMessage(string format, params object[] items) |
||||||
|
{ |
||||||
|
IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell)); |
||||||
|
Guid clsid = Guid.Empty; |
||||||
|
int result; |
||||||
|
Microsoft.VisualStudio.ErrorHandler.ThrowOnFailure( |
||||||
|
uiShell.ShowMessageBox( |
||||||
|
0, |
||||||
|
ref clsid, |
||||||
|
"ILSpy.AddIn", |
||||||
|
string.Format(CultureInfo.CurrentCulture, format, items), |
||||||
|
string.Empty, |
||||||
|
0, |
||||||
|
OLEMSGBUTTON.OLEMSGBUTTON_OK, |
||||||
|
OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST, |
||||||
|
OLEMSGICON.OLEMSGICON_INFO, |
||||||
|
0, // false
|
||||||
|
out result |
||||||
|
) |
||||||
|
); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
Binary file not shown.
@ -0,0 +1,13 @@ |
|||||||
|
// PkgCmdID.cs
|
||||||
|
// MUST match PkgCmdID.h
|
||||||
|
using System; |
||||||
|
|
||||||
|
namespace ICSharpCode.ILSpy.AddIn |
||||||
|
{ |
||||||
|
static class PkgCmdIDList |
||||||
|
{ |
||||||
|
public const uint cmdidOpenILSpy = 0x100; |
||||||
|
public const uint cmdidOpenInILSpy = 0x200; |
||||||
|
public const uint cmdidOpenDefinitionInILSpy = 0x300; |
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,36 @@ |
|||||||
|
using System; |
||||||
|
using System.Reflection; |
||||||
|
using System.Resources; |
||||||
|
using System.Runtime.CompilerServices; |
||||||
|
using System.Runtime.InteropServices; |
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("ILSpy.AddIn")] |
||||||
|
[assembly: AssemblyDescription("")] |
||||||
|
[assembly: AssemblyConfiguration("")] |
||||||
|
[assembly: AssemblyCompany("IC#Code")] |
||||||
|
[assembly: AssemblyProduct("ILSpy.AddIn")] |
||||||
|
[assembly: AssemblyCopyright("")] |
||||||
|
[assembly: AssemblyTrademark("")] |
||||||
|
[assembly: AssemblyCulture("")] |
||||||
|
[assembly: ComVisible(false)] |
||||||
|
[assembly: CLSCompliant(false)] |
||||||
|
[assembly: NeutralResourcesLanguage("en-US")] |
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")] |
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")] |
||||||
|
|
||||||
|
[assembly: InternalsVisibleTo("ILSpy.AddIn_IntegrationTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100653c4a319be4f524972c3c5bba5fd243330f8e900287d9022d7821a63fd0086fd3801e3683dbe9897f2ecc44727023e9b40adcf180730af70c81c54476b3e5ba8b0f07f5132b2c3cc54347a2c1a9d64ebaaaf3cbffc1a18c427981e2a51d53d5ab02536b7550e732f795121c38a0abfdb38596353525d034baf9e6f1fd8ac4ac")] |
||||||
|
[assembly: InternalsVisibleTo("ILSpy.AddIn_UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100653c4a319be4f524972c3c5bba5fd243330f8e900287d9022d7821a63fd0086fd3801e3683dbe9897f2ecc44727023e9b40adcf180730af70c81c54476b3e5ba8b0f07f5132b2c3cc54347a2c1a9d64ebaaaf3cbffc1a18c427981e2a51d53d5ab02536b7550e732f795121c38a0abfdb38596353525d034baf9e6f1fd8ac4ac")] |
@ -0,0 +1,63 @@ |
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.34209
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace ICSharpCode.ILSpy.AddIn { |
||||||
|
using System; |
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||||
|
/// </summary>
|
||||||
|
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||||
|
// class via a tool like ResGen or Visual Studio.
|
||||||
|
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||||
|
// with the /str option, or rebuild your VS project.
|
||||||
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] |
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
||||||
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] |
||||||
|
internal class Resources { |
||||||
|
|
||||||
|
private static global::System.Resources.ResourceManager resourceMan; |
||||||
|
|
||||||
|
private static global::System.Globalization.CultureInfo resourceCulture; |
||||||
|
|
||||||
|
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] |
||||||
|
internal Resources() { |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the cached ResourceManager instance used by this class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] |
||||||
|
internal static global::System.Resources.ResourceManager ResourceManager { |
||||||
|
get { |
||||||
|
if (object.ReferenceEquals(resourceMan, null)) { |
||||||
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ICSharpCode.ILSpy.AddIn.Resources", typeof(Resources).Assembly); |
||||||
|
resourceMan = temp; |
||||||
|
} |
||||||
|
return resourceMan; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Overrides the current thread's CurrentUICulture property for all
|
||||||
|
/// resource lookups using this strongly typed resource class.
|
||||||
|
/// </summary>
|
||||||
|
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] |
||||||
|
internal static global::System.Globalization.CultureInfo Culture { |
||||||
|
get { |
||||||
|
return resourceCulture; |
||||||
|
} |
||||||
|
set { |
||||||
|
resourceCulture = value; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,129 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<!-- |
||||||
|
VS SDK Notes: This resx file contains the resources that will be consumed directly by your package. |
||||||
|
For example, if you chose to create a tool window, there is a resource with ID 'CanNotCreateWindow'. This |
||||||
|
is used in VsPkg.cs to determine the string to show the user if there is an error when attempting to create |
||||||
|
the tool window. |
||||||
|
|
||||||
|
Resources that are accessed directly from your package *by Visual Studio* are stored in the VSPackage.resx |
||||||
|
file. |
||||||
|
--> |
||||||
|
<root> |
||||||
|
<!-- |
||||||
|
Microsoft ResX Schema |
||||||
|
|
||||||
|
Version 2.0 |
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format |
||||||
|
that is mostly human readable. The generation and parsing of the |
||||||
|
various data types are done through the TypeConverter classes |
||||||
|
associated with the data types. |
||||||
|
|
||||||
|
Example: |
||||||
|
|
||||||
|
... ado.net/XML headers & schema ... |
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader> |
||||||
|
<resheader name="version">2.0</resheader> |
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value> |
||||||
|
</data> |
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
||||||
|
<comment>This is a comment</comment> |
||||||
|
</data> |
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple |
||||||
|
name/value pairs. |
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a |
||||||
|
type or mimetype. Type corresponds to a .NET class that support |
||||||
|
text/value conversion through the TypeConverter architecture. |
||||||
|
Classes that don't support this are serialized and stored with the |
||||||
|
mimetype set. |
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the |
||||||
|
ResXResourceReader how to depersist the object. This is currently not |
||||||
|
extensible. For a given mimetype the value must be set accordingly: |
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format |
||||||
|
that the ResXResourceWriter will generate, however the reader can |
||||||
|
read any of the formats listed below. |
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64 |
||||||
|
value : The object must be serialized with |
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
||||||
|
: and then encoded with base64 encoding. |
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64 |
||||||
|
value : The object must be serialized with |
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
||||||
|
: and then encoded with base64 encoding. |
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64 |
||||||
|
value : The object must be serialized into a byte array |
||||||
|
: using a System.ComponentModel.TypeConverter |
||||||
|
: and then encoded with base64 encoding. |
||||||
|
--> |
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
||||||
|
<xsd:element name="root" msdata:IsDataSet="true"> |
||||||
|
<xsd:complexType> |
||||||
|
<xsd:choice maxOccurs="unbounded"> |
||||||
|
<xsd:element name="metadata"> |
||||||
|
<xsd:complexType> |
||||||
|
<xsd:sequence> |
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
||||||
|
</xsd:sequence> |
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" /> |
||||||
|
<xsd:attribute name="type" type="xsd:string" /> |
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" /> |
||||||
|
<xsd:attribute ref="xml:space" /> |
||||||
|
</xsd:complexType> |
||||||
|
</xsd:element> |
||||||
|
<xsd:element name="assembly"> |
||||||
|
<xsd:complexType> |
||||||
|
<xsd:attribute name="alias" type="xsd:string" /> |
||||||
|
<xsd:attribute name="name" type="xsd:string" /> |
||||||
|
</xsd:complexType> |
||||||
|
</xsd:element> |
||||||
|
<xsd:element name="data"> |
||||||
|
<xsd:complexType> |
||||||
|
<xsd:sequence> |
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
||||||
|
</xsd:sequence> |
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
||||||
|
<xsd:attribute ref="xml:space" /> |
||||||
|
</xsd:complexType> |
||||||
|
</xsd:element> |
||||||
|
<xsd:element name="resheader"> |
||||||
|
<xsd:complexType> |
||||||
|
<xsd:sequence> |
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||||
|
</xsd:sequence> |
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" /> |
||||||
|
</xsd:complexType> |
||||||
|
</xsd:element> |
||||||
|
</xsd:choice> |
||||||
|
</xsd:complexType> |
||||||
|
</xsd:element> |
||||||
|
</xsd:schema> |
||||||
|
<resheader name="resmimetype"> |
||||||
|
<value>text/microsoft-resx</value> |
||||||
|
</resheader> |
||||||
|
<resheader name="version"> |
||||||
|
<value>2.0</value> |
||||||
|
</resheader> |
||||||
|
<resheader name="reader"> |
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||||
|
</resheader> |
||||||
|
<resheader name="writer"> |
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||||
|
</resheader> |
||||||
|
</root> |
After Width: | Height: | Size: 994 B |
After Width: | Height: | Size: 18 KiB |
@ -0,0 +1,119 @@ |
|||||||
|
using System; |
||||||
|
using System.Collections.Generic; |
||||||
|
using System.ComponentModel; |
||||||
|
using System.Linq; |
||||||
|
using System.Runtime.InteropServices; |
||||||
|
using System.Text; |
||||||
|
using System.Threading.Tasks; |
||||||
|
|
||||||
|
namespace ICSharpCode.ILSpy.AddIn |
||||||
|
{ |
||||||
|
class Utils |
||||||
|
{ |
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1060:MovePInvokesToNativeMethodsClass")] |
||||||
|
[DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)] |
||||||
|
static extern unsafe char** CommandLineToArgvW([MarshalAs(UnmanagedType.LPWStr)] string lpCmdLine, out int pNumArgs); |
||||||
|
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1060:MovePInvokesToNativeMethodsClass")] |
||||||
|
[DllImport("kernel32.dll")] |
||||||
|
static extern IntPtr LocalFree(IntPtr hMem); |
||||||
|
|
||||||
|
#region CommandLine <-> Argument Array
|
||||||
|
/// <summary>
|
||||||
|
/// Decodes a command line into an array of arguments according to the CommandLineToArgvW rules.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Command line parsing rules:
|
||||||
|
/// - 2n backslashes followed by a quotation mark produce n backslashes, and the quotation mark is considered to be the end of the argument.
|
||||||
|
/// - (2n) + 1 backslashes followed by a quotation mark again produce n backslashes followed by a quotation mark.
|
||||||
|
/// - n backslashes not followed by a quotation mark simply produce n backslashes.
|
||||||
|
/// </remarks>
|
||||||
|
public static unsafe string[] CommandLineToArgumentArray(string commandLine) |
||||||
|
{ |
||||||
|
if (string.IsNullOrEmpty(commandLine)) |
||||||
|
return new string[0]; |
||||||
|
int numberOfArgs; |
||||||
|
char** arr = CommandLineToArgvW(commandLine, out numberOfArgs); |
||||||
|
if (arr == null) |
||||||
|
throw new Win32Exception(); |
||||||
|
try |
||||||
|
{ |
||||||
|
string[] result = new string[numberOfArgs]; |
||||||
|
for (int i = 0; i < numberOfArgs; i++) |
||||||
|
{ |
||||||
|
result[i] = new string(arr[i]); |
||||||
|
} |
||||||
|
return result; |
||||||
|
} |
||||||
|
finally |
||||||
|
{ |
||||||
|
// Free memory obtained by CommandLineToArgW.
|
||||||
|
LocalFree(new IntPtr(arr)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
static readonly char[] charsNeedingQuoting = { ' ', '\t', '\n', '\v', '"' }; |
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Escapes a set of arguments according to the CommandLineToArgvW rules.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Command line parsing rules:
|
||||||
|
/// - 2n backslashes followed by a quotation mark produce n backslashes, and the quotation mark is considered to be the end of the argument.
|
||||||
|
/// - (2n) + 1 backslashes followed by a quotation mark again produce n backslashes followed by a quotation mark.
|
||||||
|
/// - n backslashes not followed by a quotation mark simply produce n backslashes.
|
||||||
|
/// </remarks>
|
||||||
|
public static string ArgumentArrayToCommandLine(params string[] arguments) |
||||||
|
{ |
||||||
|
if (arguments == null) |
||||||
|
return null; |
||||||
|
StringBuilder b = new StringBuilder(); |
||||||
|
for (int i = 0; i < arguments.Length; i++) |
||||||
|
{ |
||||||
|
if (i > 0) |
||||||
|
b.Append(' '); |
||||||
|
AppendArgument(b, arguments[i]); |
||||||
|
} |
||||||
|
return b.ToString(); |
||||||
|
} |
||||||
|
|
||||||
|
static void AppendArgument(StringBuilder b, string arg) |
||||||
|
{ |
||||||
|
if (arg.Length > 0 && arg.IndexOfAny(charsNeedingQuoting) < 0) |
||||||
|
{ |
||||||
|
b.Append(arg); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
b.Append('"'); |
||||||
|
for (int j = 0; ; j++) |
||||||
|
{ |
||||||
|
int backslashCount = 0; |
||||||
|
while (j < arg.Length && arg[j] == '\\') |
||||||
|
{ |
||||||
|
backslashCount++; |
||||||
|
j++; |
||||||
|
} |
||||||
|
if (j == arg.Length) |
||||||
|
{ |
||||||
|
b.Append('\\', backslashCount * 2); |
||||||
|
break; |
||||||
|
} |
||||||
|
else if (arg[j] == '"') |
||||||
|
{ |
||||||
|
b.Append('\\', backslashCount * 2 + 1); |
||||||
|
b.Append('"'); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
b.Append('\\', backslashCount); |
||||||
|
b.Append(arg[j]); |
||||||
|
} |
||||||
|
} |
||||||
|
b.Append('"'); |
||||||
|
} |
||||||
|
} |
||||||
|
#endregion
|
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,140 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<!-- |
||||||
|
VS SDK Notes: This resx file contains the resources that will be consumed from your package by Visual Studio. |
||||||
|
For example, Visual Studio will attempt to load resource '400' from this resource stream when it needs to |
||||||
|
load your package's icon. Because Visual Studio will always look in the VSPackage.resources stream first for |
||||||
|
resources it needs, you should put additional resources that Visual Studio will load directly into this resx |
||||||
|
file. |
||||||
|
|
||||||
|
Resources that you would like to access directly from your package in a strong-typed fashion should be stored |
||||||
|
in Resources.resx or another resx file. |
||||||
|
--> |
||||||
|
<root> |
||||||
|
<!-- |
||||||
|
Microsoft ResX Schema |
||||||
|
|
||||||
|
Version 2.0 |
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format |
||||||
|
that is mostly human readable. The generation and parsing of the |
||||||
|
various data types are done through the TypeConverter classes |
||||||
|
associated with the data types. |
||||||
|
|
||||||
|
Example: |
||||||
|
|
||||||
|
... ado.net/XML headers & schema ... |
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader> |
||||||
|
<resheader name="version">2.0</resheader> |
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value> |
||||||
|
</data> |
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
||||||
|
<comment>This is a comment</comment> |
||||||
|
</data> |
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple |
||||||
|
name/value pairs. |
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a |
||||||
|
type or mimetype. Type corresponds to a .NET class that support |
||||||
|
text/value conversion through the TypeConverter architecture. |
||||||
|
Classes that don't support this are serialized and stored with the |
||||||
|
mimetype set. |
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the |
||||||
|
ResXResourceReader how to depersist the object. This is currently not |
||||||
|
extensible. For a given mimetype the value must be set accordingly: |
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format |
||||||
|
that the ResXResourceWriter will generate, however the reader can |
||||||
|
read any of the formats listed below. |
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64 |
||||||
|
value : The object must be serialized with |
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
||||||
|
: and then encoded with base64 encoding. |
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64 |
||||||
|
value : The object must be serialized with |
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
||||||
|
: and then encoded with base64 encoding. |
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64 |
||||||
|
value : The object must be serialized into a byte array |
||||||
|
: using a System.ComponentModel.TypeConverter |
||||||
|
: and then encoded with base64 encoding. |
||||||
|
--> |
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
||||||
|
<xsd:element name="root" msdata:IsDataSet="true"> |
||||||
|
<xsd:complexType> |
||||||
|
<xsd:choice maxOccurs="unbounded"> |
||||||
|
<xsd:element name="metadata"> |
||||||
|
<xsd:complexType> |
||||||
|
<xsd:sequence> |
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
||||||
|
</xsd:sequence> |
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" /> |
||||||
|
<xsd:attribute name="type" type="xsd:string" /> |
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" /> |
||||||
|
<xsd:attribute ref="xml:space" /> |
||||||
|
</xsd:complexType> |
||||||
|
</xsd:element> |
||||||
|
<xsd:element name="assembly"> |
||||||
|
<xsd:complexType> |
||||||
|
<xsd:attribute name="alias" type="xsd:string" /> |
||||||
|
<xsd:attribute name="name" type="xsd:string" /> |
||||||
|
</xsd:complexType> |
||||||
|
</xsd:element> |
||||||
|
<xsd:element name="data"> |
||||||
|
<xsd:complexType> |
||||||
|
<xsd:sequence> |
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
||||||
|
</xsd:sequence> |
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
||||||
|
<xsd:attribute ref="xml:space" /> |
||||||
|
</xsd:complexType> |
||||||
|
</xsd:element> |
||||||
|
<xsd:element name="resheader"> |
||||||
|
<xsd:complexType> |
||||||
|
<xsd:sequence> |
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
||||||
|
</xsd:sequence> |
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" /> |
||||||
|
</xsd:complexType> |
||||||
|
</xsd:element> |
||||||
|
</xsd:choice> |
||||||
|
</xsd:complexType> |
||||||
|
</xsd:element> |
||||||
|
</xsd:schema> |
||||||
|
<resheader name="resmimetype"> |
||||||
|
<value>text/microsoft-resx</value> |
||||||
|
</resheader> |
||||||
|
<resheader name="version"> |
||||||
|
<value>2.0</value> |
||||||
|
</resheader> |
||||||
|
<resheader name="reader"> |
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||||
|
</resheader> |
||||||
|
<resheader name="writer"> |
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
||||||
|
</resheader> |
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
||||||
|
<data name="110" xml:space="preserve"> |
||||||
|
<value>ILSpy.AddIn</value> |
||||||
|
</data> |
||||||
|
<data name="112" xml:space="preserve"> |
||||||
|
<value>Integration of the ILSpy Decompiler into Visual Studio.</value> |
||||||
|
</data> |
||||||
|
<data name="400" type="System.Resources.ResXFileRef, System.Windows.Forms"> |
||||||
|
<value>Resources\Package.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> |
||||||
|
</data> |
||||||
|
</root> |
@ -0,0 +1,12 @@ |
|||||||
|
The following MIT license applies to ILSpy, NRefactory and ICSharpCode.Decompiler. Mono.Cecil also uses the MIT license (Copyright JB Evain). AvalonEdit and SharpTreeView use LGPL, which can be found in the LGPL.txt file. ILSpy.BamlDecompiler uses the MS-PL, which can be found in the MS-PL.txt file. |
||||||
|
|
||||||
|
|
||||||
|
MIT license: |
||||||
|
|
||||||
|
Copyright (c) 2011-2014 AlphaSierraPapa for the SharpDevelop team |
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@ -0,0 +1,20 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011"> |
||||||
|
<Metadata> |
||||||
|
<Identity Id="a9120dbe-164a-4891-842f-fb7829273838" Version="1.0" Language="en-US" Publisher="IC#Code" /> |
||||||
|
<DisplayName>ILSpy</DisplayName> |
||||||
|
<Description>Integration of the ILSpy Decompiler into Visual Studio.</Description> |
||||||
|
<License>license.txt</License> |
||||||
|
<Icon>ILSpy-Large.ico</Icon> |
||||||
|
</Metadata> |
||||||
|
<Installation InstalledByMsi="false"> |
||||||
|
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[12.0]" /> |
||||||
|
</Installation> |
||||||
|
<Dependencies> |
||||||
|
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" /> |
||||||
|
<Dependency Id="Microsoft.VisualStudio.MPF.12.0" DisplayName="Visual Studio MPF 12.0" d:Source="Installed" Version="[12.0]" /> |
||||||
|
</Dependencies> |
||||||
|
<Assets> |
||||||
|
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" /> |
||||||
|
</Assets> |
||||||
|
</PackageManifest> |
Loading…
Reference in new issue