diff --git a/Frontends.sln b/Frontends.sln index 36c395b93..bd714df16 100644 --- a/Frontends.sln +++ b/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}" diff --git a/ICSharpCode.Decompiler.Console/Program.cs b/ICSharpCode.Decompiler.Console/Program.cs index 7649fab2e..ca8f96cf9 100644 --- a/ICSharpCode.Decompiler.Console/Program.cs +++ b/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 kinds) diff --git a/ICSharpCode.Decompiler.PowerShell/ErrorIds.cs b/ICSharpCode.Decompiler.PowerShell/ErrorIds.cs index 9554e449e..7d592d8fa 100644 --- a/ICSharpCode.Decompiler.PowerShell/ErrorIds.cs +++ b/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"; + } } diff --git a/ICSharpCode.Decompiler.PowerShell/GetDecompiledProjectCmdlet.cs b/ICSharpCode.Decompiler.PowerShell/GetDecompiledProjectCmdlet.cs index f5fa4579e..809bbb3b7 100644 --- a/ICSharpCode.Decompiler.PowerShell/GetDecompiledProjectCmdlet.cs +++ b/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)); + } + } + } } diff --git a/ICSharpCode.Decompiler.PowerShell/GetDecompiledSourceCmdlet.cs b/ICSharpCode.Decompiler.PowerShell/GetDecompiledSourceCmdlet.cs index 845f69028..a63242ecf 100644 --- a/ICSharpCode.Decompiler.PowerShell/GetDecompiledSourceCmdlet.cs +++ b/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()); diff --git a/ICSharpCode.Decompiler.PowerShell/GetDecompiledTypesCmdlet.cs b/ICSharpCode.Decompiler.PowerShell/GetDecompiledTypesCmdlet.cs index 19d910533..16451e041 100644 --- a/ICSharpCode.Decompiler.PowerShell/GetDecompiledTypesCmdlet.cs +++ b/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 kinds = TypesParser.ParseSelection(Types); + protected override void ProcessRecord() + { + HashSet kinds = TypesParser.ParseSelection(Types); - try { - List output = new List(); - foreach (var type in Decompiler.TypeSystem.MainModule.TypeDefinitions) { - if (!kinds.Contains(type.Kind)) - continue; - output.Add(type); - } + try { + List output = new List(); + 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)); + } + } + } } diff --git a/ICSharpCode.Decompiler.PowerShell/GetDecompilerCmdlet.cs b/ICSharpCode.Decompiler.PowerShell/GetDecompilerCmdlet.cs index 7afddec54..1ce6f300a 100644 --- a/ICSharpCode.Decompiler.PowerShell/GetDecompilerCmdlet.cs +++ b/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)); + } + } + } } diff --git a/ILSpy.sln b/ILSpy.sln index 39a095e23..2e0b1b0ac 100644 --- a/ILSpy.sln +++ b/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}"