Browse Source

add ILSpyDisplayBinding

pull/80/head
Siegfried Pammer 12 years ago
parent
commit
9dfbeb3bcf
  1. 7
      src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyAddIn.addin
  2. 3
      src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyAddIn.csproj
  3. 34
      src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyDisplayBinding.cs

7
src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyAddIn.addin

@ -32,4 +32,11 @@ @@ -32,4 +32,11 @@
<MenuItem id="ILSpySeparator" type="Separator" />
<MenuItem id="ILSpy" icon="ILSpy" type="Item" label="${res:ILSpyAddIn.OpenILSpyCommand}" class="ICSharpCode.ILSpyAddIn.OpenInILSpyCommand"/>
</Path>
<Path name = "/SharpDevelop/Workbench/DisplayBindings/UrlBased">
<DisplayBinding id = "ILSpyView"
class = "ICSharpCode.ILSpyAddIn.ILSpyDisplayBinding"
fileNamePattern = "^ilspy://"
title = "ILSpy Decompiler View"/>
</Path>
</AddIn>

3
src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyAddIn.csproj

@ -66,7 +66,9 @@ @@ -66,7 +66,9 @@
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="DebuggerTextOutput.cs" />
<Compile Include="DecompiledViewContent.cs" />
<Compile Include="ILSpyDecompilerService.cs" />
<Compile Include="ILSpyDisplayBinding.cs" />
<Compile Include="ILSpyFullParseInformation.cs" />
<Compile Include="ILSpyParser.cs" />
<Compile Include="ILSpySymbolSource.cs" />
@ -81,7 +83,6 @@ @@ -81,7 +83,6 @@
<DependentUpon>SetILSpyPathDialog.cs</DependentUpon>
</Compile>
<Compile Include="LaunchILSpy\OpenInILSpyCommand.cs" />
<Compile Include="ViewContent\DecompiledViewContent.cs" />
<EmbeddedResource Include="LaunchILSpy\SetILSpyPathDialog.resx">
<DependentUpon>SetILSpyPathDialog.cs</DependentUpon>
</EmbeddedResource>

34
src/AddIns/DisplayBindings/ILSpyAddIn/ILSpyDisplayBinding.cs

@ -0,0 +1,34 @@ @@ -0,0 +1,34 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.IO;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Workbench;
namespace ICSharpCode.ILSpyAddIn
{
public class ILSpyDisplayBinding : IDisplayBinding
{
public bool IsPreferredBindingForFile(FileName fileName)
{
return fileName.ToString().StartsWith("ilspy://", StringComparison.OrdinalIgnoreCase);
}
public bool CanCreateContentForFile(FileName fileName)
{
return fileName.ToString().StartsWith("ilspy://", StringComparison.OrdinalIgnoreCase);
}
public double AutoDetectFileContent(FileName fileName, Stream fileContent, string detectedMimeType)
{
return 1;
}
public IViewContent CreateContentForFile(OpenedFile file)
{
return new DecompiledViewContent(DecompiledTypeReference.FromFileName(file.FileName), "");
}
}
}
Loading…
Cancel
Save