Browse Source

Remove references to non-existent Rebracer.xml and apply .editorconfig formatting to projects in Frontends.sln.

pull/1274/merge
Siegfried Pammer 7 years ago
parent
commit
728d7c1442
  1. 5
      Frontends.sln
  2. 2
      ICSharpCode.Decompiler.Console/Program.cs
  3. 10
      ICSharpCode.Decompiler.PowerShell/ErrorIds.cs
  4. 56
      ICSharpCode.Decompiler.PowerShell/GetDecompiledProjectCmdlet.cs
  5. 3
      ICSharpCode.Decompiler.PowerShell/GetDecompiledSourceCmdlet.cs
  6. 50
      ICSharpCode.Decompiler.PowerShell/GetDecompiledTypesCmdlet.cs
  7. 42
      ICSharpCode.Decompiler.PowerShell/GetDecompilerCmdlet.cs
  8. 5
      ILSpy.sln

5
Frontends.sln

@ -10,11 +10,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{F45DB999-7E7
doc\IntPtr.txt = doc\IntPtr.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0A344E19-D1FC-4F4C-8883-0844AC669113}"
ProjectSection(SolutionItems) = preProject
Rebracer.xml = Rebracer.xml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler.Console", "ICSharpCode.Decompiler.Console\ICSharpCode.Decompiler.Console.csproj", "{8FDA011E-FAF8-4C1F-A695-21E2C6B5375F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler.PowerShell", "ICSharpCode.Decompiler.PowerShell\ICSharpCode.Decompiler.PowerShell.csproj", "{FF7D6041-3C52-47D1-A32A-0BFE8EE4EEEB}"

2
ICSharpCode.Decompiler.Console/Program.cs

@ -77,7 +77,7 @@ namespace ICSharpCode.Decompiler.Console
static CSharpDecompiler GetDecompiler(string assemblyFileName)
{
return new CSharpDecompiler(assemblyFileName, new DecompilerSettings() { ThrowOnAssemblyResolveErrors = false });
return new CSharpDecompiler(assemblyFileName, new DecompilerSettings() { ThrowOnAssemblyResolveErrors = false });
}
static void ListContent(string assemblyFileName, TextWriter output, ISet<TypeKind> kinds)

10
ICSharpCode.Decompiler.PowerShell/ErrorIds.cs

@ -4,9 +4,9 @@ using System.Text;
namespace ICSharpCode.Decompiler.PowerShell
{
public static class ErrorIds
{
public static readonly string AssemblyLoadFailed = "1";
public static readonly string DecompilationFailed = "2";
}
public static class ErrorIds
{
public static readonly string AssemblyLoadFailed = "1";
public static readonly string DecompilationFailed = "2";
}
}

56
ICSharpCode.Decompiler.PowerShell/GetDecompiledProjectCmdlet.cs

@ -7,37 +7,35 @@ using ICSharpCode.Decompiler.CSharp;
namespace ICSharpCode.Decompiler.PowerShell
{
[Cmdlet(VerbsCommon.Get, "DecompiledProject")]
[OutputType(typeof(string))]
public class GetDecompiledProjectCmdlet : PSCmdlet
{
[Parameter(Position = 0, Mandatory = true)]
public CSharpDecompiler Decompiler { get; set; }
[Cmdlet(VerbsCommon.Get, "DecompiledProject")]
[OutputType(typeof(string))]
public class GetDecompiledProjectCmdlet : PSCmdlet
{
[Parameter(Position = 0, Mandatory = true)]
public CSharpDecompiler Decompiler { get; set; }
[Parameter(Position = 1, Mandatory = true)]
[Alias("PSPath", "OutputPath")]
[ValidateNotNullOrEmpty]
public string LiteralPath { get; set; }
[Parameter(Position = 1, Mandatory = true)]
[Alias("PSPath", "OutputPath")]
[ValidateNotNullOrEmpty]
public string LiteralPath { get; set; }
protected override void ProcessRecord()
{
string path = GetUnresolvedProviderPathFromPSPath(LiteralPath);
if (!Directory.Exists(path))
{
WriteObject("Destination directory must exist prior to decompilation");
return;
}
protected override void ProcessRecord()
{
string path = GetUnresolvedProviderPathFromPSPath(LiteralPath);
if (!Directory.Exists(path)) {
WriteObject("Destination directory must exist prior to decompilation");
return;
}
try
{
WholeProjectDecompiler decompiler = new WholeProjectDecompiler();
decompiler.DecompileProject(Decompiler.TypeSystem.MainModule.PEFile, path);
try {
WholeProjectDecompiler decompiler = new WholeProjectDecompiler();
decompiler.DecompileProject(Decompiler.TypeSystem.MainModule.PEFile, path);
WriteObject("Decompilation finished");
} catch (Exception e) {
WriteVerbose(e.ToString());
WriteError(new ErrorRecord(e, ErrorIds.DecompilationFailed, ErrorCategory.OperationStopped, null));
}
}
}
WriteObject("Decompilation finished");
} catch (Exception e) {
WriteVerbose(e.ToString());
WriteError(new ErrorRecord(e, ErrorIds.DecompilationFailed, ErrorCategory.OperationStopped, null));
}
}
}
}

3
ICSharpCode.Decompiler.PowerShell/GetDecompiledSourceCmdlet.cs

@ -20,8 +20,7 @@ namespace ICSharpCode.Decompiler.PowerShell
protected override void ProcessRecord()
{
try
{
try {
StringWriter output = new StringWriter();
if (TypeName == null) {
output.Write(Decompiler.DecompileWholeModuleAsString());

50
ICSharpCode.Decompiler.PowerShell/GetDecompiledTypesCmdlet.cs

@ -9,33 +9,33 @@ using ICSharpCode.Decompiler.TypeSystem;
namespace ICSharpCode.Decompiler.PowerShell
{
[Cmdlet(VerbsCommon.Get, "DecompiledTypes")]
[OutputType(typeof(ITypeDefinition[]))]
public class GetDecompiledTypesCmdlet : PSCmdlet
{
[Parameter(Position = 0, Mandatory = true)]
public CSharpDecompiler Decompiler { get; set; }
[Cmdlet(VerbsCommon.Get, "DecompiledTypes")]
[OutputType(typeof(ITypeDefinition[]))]
public class GetDecompiledTypesCmdlet : PSCmdlet
{
[Parameter(Position = 0, Mandatory = true)]
public CSharpDecompiler Decompiler { get; set; }
[Parameter(Mandatory = true)]
public string[] Types { get; set; }
[Parameter(Mandatory = true)]
public string[] Types { get; set; }
protected override void ProcessRecord()
{
HashSet<TypeKind> kinds = TypesParser.ParseSelection(Types);
protected override void ProcessRecord()
{
HashSet<TypeKind> kinds = TypesParser.ParseSelection(Types);
try {
List<ITypeDefinition> output = new List<ITypeDefinition>();
foreach (var type in Decompiler.TypeSystem.MainModule.TypeDefinitions) {
if (!kinds.Contains(type.Kind))
continue;
output.Add(type);
}
try {
List<ITypeDefinition> output = new List<ITypeDefinition>();
foreach (var type in Decompiler.TypeSystem.MainModule.TypeDefinitions) {
if (!kinds.Contains(type.Kind))
continue;
output.Add(type);
}
WriteObject(output.ToArray());
} catch (Exception e) {
WriteVerbose(e.ToString());
WriteError(new ErrorRecord(e, ErrorIds.DecompilationFailed, ErrorCategory.OperationStopped, null));
}
}
}
WriteObject(output.ToArray());
} catch (Exception e) {
WriteVerbose(e.ToString());
WriteError(new ErrorRecord(e, ErrorIds.DecompilationFailed, ErrorCategory.OperationStopped, null));
}
}
}
}

42
ICSharpCode.Decompiler.PowerShell/GetDecompilerCmdlet.cs

@ -6,29 +6,29 @@ using ICSharpCode.Decompiler.CSharp;
namespace ICSharpCode.Decompiler.PowerShell
{
[Cmdlet(VerbsCommon.Get, "Decompiler")]
[OutputType(typeof(CSharpDecompiler))]
public class GetDecompilerCmdlet : PSCmdlet
{
[Parameter(Position = 0, Mandatory = true, HelpMessage = "Path to the assembly you want to decompile")]
[Alias("PSPath")]
[ValidateNotNullOrEmpty]
public string LiteralPath { get; set; }
[Cmdlet(VerbsCommon.Get, "Decompiler")]
[OutputType(typeof(CSharpDecompiler))]
public class GetDecompilerCmdlet : PSCmdlet
{
[Parameter(Position = 0, Mandatory = true, HelpMessage = "Path to the assembly you want to decompile")]
[Alias("PSPath")]
[ValidateNotNullOrEmpty]
public string LiteralPath { get; set; }
protected override void ProcessRecord()
{
string path = GetUnresolvedProviderPathFromPSPath(LiteralPath);
protected override void ProcessRecord()
{
string path = GetUnresolvedProviderPathFromPSPath(LiteralPath);
try {
var decompiler = new CSharpDecompiler(path, new DecompilerSettings() {
try {
var decompiler = new CSharpDecompiler(path, new DecompilerSettings() {
ThrowOnAssemblyResolveErrors = false
});
WriteObject(decompiler);
});
WriteObject(decompiler);
} catch (Exception e) {
WriteVerbose(e.ToString());
WriteError(new ErrorRecord(e, ErrorIds.AssemblyLoadFailed, ErrorCategory.OperationStopped, null));
}
}
}
} catch (Exception e) {
WriteVerbose(e.ToString());
WriteError(new ErrorRecord(e, ErrorIds.AssemblyLoadFailed, ErrorCategory.OperationStopped, null));
}
}
}
}

5
ILSpy.sln

@ -26,11 +26,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy.BamlDecompiler.Tests"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy.AddIn", "ILSpy.AddIn\ILSpy.AddIn.csproj", "{9D7BE6C0-B7B3-4A50-A54E-18A2D84A3384}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0A344E19-D1FC-4F4C-8883-0844AC669113}"
ProjectSection(SolutionItems) = preProject
Rebracer.xml = Rebracer.xml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler.PdbProvider.Cecil", "ICSharpCode.Decompiler.PdbProvider.Cecil\ICSharpCode.Decompiler.PdbProvider.Cecil.csproj", "{B85A155A-9DD6-43BC-A624-2D8EC773D71F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ILSpy.Tests", "ILSpy.Tests\ILSpy.Tests.csproj", "{B51C6636-B8D1-4200-9869-08F2689DE6C2}"

Loading…
Cancel
Save