diff --git a/BuildTools/sort-resx.ps1 b/BuildTools/sort-resx.ps1
new file mode 100644
index 000000000..d85d46849
--- /dev/null
+++ b/BuildTools/sort-resx.ps1
@@ -0,0 +1,18 @@
+$ErrorActionPreference = "Stop";
+
+[Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq") | Out-Null
+
+Write-Host "Sorting .resx files...";
+
+Get-ChildItem -Include *.resx -Recurse | foreach ($_) {
+ Write-Host $_.FullName;
+
+ $doc = [System.Xml.Linq.XDocument]::Load($_.FullName);
+ $descendants = [System.Linq.Enumerable]::ToArray($doc.Descendants("data"));
+
+ [System.Xml.Linq.Extensions]::Remove($descendants);
+ $ordered = [System.Linq.Enumerable]::OrderBy($descendants, [System.Func[System.Xml.Linq.XElement,string]] { param ($e) $e.Attribute("name").Value }, [System.StringComparer]::Ordinal);
+ $doc.Root.Add($ordered);
+ $doc.Save($_.FullName);
+}
+
diff --git a/DecompilerNuGetDemos.workbook b/DecompilerNuGetDemos.workbook
index d5ccd0ea1..a71208905 100644
--- a/DecompilerNuGetDemos.workbook
+++ b/DecompilerNuGetDemos.workbook
@@ -6,7 +6,7 @@ platforms:
- DotNetCore
packages:
- id: ICSharpCode.Decompiler
- version: 6.0.0.5836
+ version: 6.1.0.5902
---
Setup: load the references required to work with the decompiler
diff --git a/ICSharpCode.Decompiler.Console/ICSharpCode.Decompiler.Console.csproj b/ICSharpCode.Decompiler.Console/ICSharpCode.Decompiler.Console.csproj
index f4e9b1467..bf463c7db 100644
--- a/ICSharpCode.Decompiler.Console/ICSharpCode.Decompiler.Console.csproj
+++ b/ICSharpCode.Decompiler.Console/ICSharpCode.Decompiler.Console.csproj
@@ -8,7 +8,7 @@
true
ilspycmd
ilspycmd
- 6.0.0.5836
+ 6.1.0.5902
Command-line decompiler using the ILSpy decompilation engine
Copyright 2011-2020 AlphaSierraPapa
https://github.com/icsharpcode/ILSpy/
@@ -16,8 +16,8 @@
ILSpyCmdNuGetPackageIcon.png
https://github.com/icsharpcode/ILSpy/
- 6.0.0.0
- 6.0.0.0
+ 6.1.0.0
+ 6.1.0.0
true
ILSpy Team
@@ -42,7 +42,7 @@
-
+
diff --git a/ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj b/ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj
index 1db847e93..5028997c6 100644
--- a/ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj
+++ b/ICSharpCode.Decompiler.PowerShell/ICSharpCode.Decompiler.PowerShell.csproj
@@ -17,7 +17,7 @@
-
+
diff --git a/ICSharpCode.Decompiler.Tests/DataFlowTest.cs b/ICSharpCode.Decompiler.Tests/DataFlowTest.cs
index 3c599ccc2..8c49c3949 100644
--- a/ICSharpCode.Decompiler.Tests/DataFlowTest.cs
+++ b/ICSharpCode.Decompiler.Tests/DataFlowTest.cs
@@ -55,10 +55,14 @@ namespace ICSharpCode.Decompiler.Tests
public void TryFinallyWithAssignmentInFinally()
{
ILVariable v = new ILVariable(VariableKind.Local, SpecialType.UnknownType, 0);
- ILFunction f = new ILFunction((IMethod)null, 0, new GenericContext(), new TryFinally(
- new Nop(),
- new StLoc(v, new LdcI4(0))
- ));
+ ILFunction f = new ILFunction(
+ returnType: SpecialType.UnknownType,
+ parameters: new IParameter[0],
+ genericContext: new GenericContext(),
+ body: new TryFinally(
+ new Nop(),
+ new StLoc(v, new LdcI4(0))
+ ));
f.AddRef();
f.Variables.Add(v);
f.Body.AcceptVisitor(new RDTest(f, v));
diff --git a/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs b/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs
index 1dc72a59f..6bc3c6a9f 100644
--- a/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs
+++ b/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs
@@ -185,7 +185,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
return Regex.Replace(il, @"'\{[0-9A-F-]+\}'", "''");
}
- static readonly string coreRefAsmPath = new DotNetCorePathFinder(new Version(3, 1)).GetReferenceAssemblyPath(".NETCoreApp, Version = v3.1");
+ static readonly string coreRefAsmPath = new DotNetCorePathFinder(TargetFrameworkIdentifier.NETCoreApp, new Version(3, 1)).GetReferenceAssemblyPath(".NETCoreApp, Version = v3.1");
static readonly string refAsmPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86),
@"Reference Assemblies\Microsoft\Framework\.NETFramework\v4.7.2");
@@ -251,6 +251,10 @@ namespace ICSharpCode.Decompiler.Tests.Helpers
preprocessorSymbols.Add("VB11");
preprocessorSymbols.Add("VB14");
preprocessorSymbols.Add("VB15");
+
+ if (flags.HasFlag(CompilerOptions.Preview)) {
+ preprocessorSymbols.Add("CS90");
+ }
} else if (flags.HasFlag(CompilerOptions.UseMcs)) {
preprocessorSymbols.Add("MCS");
} else {
diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
index c8e8d2721..62b9b5535 100644
--- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
+++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
@@ -42,8 +42,8 @@
-
-
+
+
@@ -92,6 +92,7 @@
+
diff --git a/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs
index d9a9e2ede..cd864eab9 100644
--- a/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs
+++ b/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs
@@ -127,13 +127,13 @@ namespace ICSharpCode.Decompiler.Tests
[Test]
public void CS1xSwitch_Debug()
{
- Run();
+ Run(settings: new DecompilerSettings { SwitchExpressions = false });
}
[Test]
public void CS1xSwitch_Release()
{
- Run();
+ Run(settings: new DecompilerSettings { SwitchExpressions = false });
}
[Test]
diff --git a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs
index c5687aa85..fa6fc7ccf 100644
--- a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs
+++ b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs
@@ -135,10 +135,17 @@ namespace ICSharpCode.Decompiler.Tests
{
RunForLibrary(cscOptions: cscOptions, decompilerSettings: new DecompilerSettings {
// legacy csc generates a dead store in debug builds
- RemoveDeadStores = (cscOptions == CompilerOptions.None)
+ RemoveDeadStores = (cscOptions == CompilerOptions.None),
+ SwitchExpressions = false,
});
}
+ [Test]
+ public void SwitchExpressions([ValueSource(nameof(roslynOnlyOptions))] CompilerOptions cscOptions)
+ {
+ RunForLibrary(cscOptions: cscOptions);
+ }
+
[Test]
public void ReduceNesting([ValueSource(nameof(defaultOptions))] CompilerOptions cscOptions)
{
@@ -148,7 +155,7 @@ namespace ICSharpCode.Decompiler.Tests
[Test]
public void DelegateConstruction([ValueSource(nameof(defaultOptionsWithMcs))] CompilerOptions cscOptions)
{
- RunForLibrary(cscOptions: cscOptions);
+ RunForLibrary(cscOptions: cscOptions | CompilerOptions.Preview);
}
[Test]
@@ -199,7 +206,7 @@ namespace ICSharpCode.Decompiler.Tests
[Test]
public void LocalFunctions([ValueSource(nameof(roslynOnlyOptions))] CompilerOptions cscOptions)
{
- RunForLibrary(cscOptions: cscOptions);
+ RunForLibrary(cscOptions: cscOptions | CompilerOptions.Preview);
}
[Test]
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Unsafe.cs b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Unsafe.cs
index 777dcedd1..4bac5c052 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Unsafe.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Unsafe.cs
@@ -228,7 +228,7 @@ namespace System.Runtime.CompilerServices
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static IntPtr ByteOffset(ref T origin, ref T target)
{
- return Unsafe.ByteOffset(ref target, ref origin);
+ return Unsafe.ByteOffset(target: ref target, origin: ref origin);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs
index a73252ee0..8d5f6fdab 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs
@@ -428,6 +428,18 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
return () => valueTuple.RenamedString;
}
#endif
+
+ public static Func Identity()
+ {
+ return (T _) => _;
+ }
+
+#if CS90
+ public static Func LambdaParameterDiscard()
+ {
+ return (int _, int _, int _) => 0;
+ }
+#endif
}
public class Issue1867
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/LocalFunctions.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/LocalFunctions.cs
index 1f73795e2..c38a81c17 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/LocalFunctions.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/LocalFunctions.cs
@@ -23,6 +23,12 @@ namespace LocalFunctions
{
internal class LocalFunctions
{
+ [AttributeUsage(AttributeTargets.All)]
+ internal class MyAttribute : Attribute
+ {
+
+ }
+
public class Generic where T1 : struct, ICloneable, IConvertible
{
public int MixedLocalFunction() where T2 : ICloneable, IConvertible
@@ -31,15 +37,21 @@ namespace LocalFunctions
object z = this;
for (int j = 0; j < 10; j++) {
int i = 0;
- i += NonStaticMethod6
-
+
+
+ false
+ false
+
+
@@ -85,10 +89,20 @@
Resources.Designer.cs
Designer
+
+ true
+ VSPackage.en-US.resources
+ VSPackage.resx
+
true
VSPackage
+
+ true
+ VSPackage.zh-Hans.resources
+ VSPackage.resx
+
-
-
-
- Designer
-
+
+ true
+ \ILSpy
+
-
+
+ true
+ \ILSpy\zh-Hans\
+
-
+
+
+ Designer
+
+
+
+
+ Designer
+
+
+ true
+ Always
+
+
Menus.ctmenu
Designer
+ ILSpyAddIn.vsct
+
+ Menus.ctmenu
+ Designer
+ ILSpyAddIn.vsct
+
+
+
+
diff --git a/ILSpy.AddIn/ILSpyAddIn.en-US.vsct b/ILSpy.AddIn/ILSpyAddIn.en-US.vsct
new file mode 100644
index 000000000..a6a3c6947
--- /dev/null
+++ b/ILSpy.AddIn/ILSpyAddIn.en-US.vsct
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ILSpy.AddIn/ILSpyAddIn.vsct b/ILSpy.AddIn/ILSpyAddIn.vsct
index d747baf57..3d992eae7 100644
--- a/ILSpy.AddIn/ILSpyAddIn.vsct
+++ b/ILSpy.AddIn/ILSpyAddIn.vsct
@@ -20,9 +20,6 @@
-
-
-
@@ -34,7 +31,7 @@
group; your package should define its own command set in order to avoid collisions
with command ids defined by other packages. -->
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -136,7 +80,7 @@
-
+
diff --git a/ILSpy.AddIn/ILSpyAddIn.zh-Hans.vsct b/ILSpy.AddIn/ILSpyAddIn.zh-Hans.vsct
new file mode 100644
index 000000000..d50bfb062
--- /dev/null
+++ b/ILSpy.AddIn/ILSpyAddIn.zh-Hans.vsct
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ILSpy.AddIn/ILSpyAddInPackage.cs b/ILSpy.AddIn/ILSpyAddInPackage.cs
index 533a78bdd..950cdc0d5 100644
--- a/ILSpy.AddIn/ILSpyAddInPackage.cs
+++ b/ILSpy.AddIn/ILSpyAddInPackage.cs
@@ -37,6 +37,7 @@ namespace ICSharpCode.ILSpy.AddIn
[ProvideMenuResource("Menus.ctmenu", 1)]
[Guid(GuidList.guidILSpyAddInPkgString)]
[ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_string, PackageAutoLoadFlags.BackgroundLoad)]
+ [ProvideBindingPath]
public sealed class ILSpyAddInPackage : AsyncPackage
{
///
diff --git a/ILSpy.AddIn/ILSpyInstance.cs b/ILSpy.AddIn/ILSpyInstance.cs
index adf922328..182ee3e9e 100644
--- a/ILSpy.AddIn/ILSpyInstance.cs
+++ b/ILSpy.AddIn/ILSpyInstance.cs
@@ -12,11 +12,11 @@ namespace ICSharpCode.ILSpy.AddIn
{
public ILSpyParameters(IEnumerable assemblyFileNames, params string[] arguments)
{
- this.AssemblyFileNames = assemblyFileNames;
+ this.AssemblyFileNames = assemblyFileNames.ToArray();
this.Arguments = arguments;
}
- public IEnumerable AssemblyFileNames { get; private set; }
+ public string[] AssemblyFileNames { get; private set; }
public string[] Arguments { get; private set; }
}
@@ -32,16 +32,16 @@ namespace ICSharpCode.ILSpy.AddIn
static string GetILSpyPath()
{
var basePath = Path.GetDirectoryName(typeof(ILSpyAddInPackage).Assembly.Location);
- return Path.Combine(basePath, "ILSpy.exe");
+ return Path.Combine(basePath, "ILSpy", "ILSpy.exe");
}
public void Start()
{
var commandLineArguments = parameters?.AssemblyFileNames?.Concat(parameters.Arguments);
-
+ string ilSpyExe = GetILSpyPath();
var process = new Process() {
StartInfo = new ProcessStartInfo() {
- FileName = GetILSpyPath(),
+ FileName = ilSpyExe,
UseShellExecute = false,
Arguments = "/navigateTo:none"
}
@@ -50,13 +50,14 @@ namespace ICSharpCode.ILSpy.AddIn
if ((commandLineArguments != null) && commandLineArguments.Any()) {
// Only need a message to started process if there are any parameters to pass
- SendMessage(process, "ILSpy:\r\n" + string.Join(Environment.NewLine, commandLineArguments), true);
+ SendMessage(ilSpyExe, "ILSpy:\r\n" + string.Join(Environment.NewLine, commandLineArguments), true);
}
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "VSTHRD110:Observe result of async calls", Justification = "")]
- void SendMessage(Process ilspyProcess, string message, bool activate)
+ void SendMessage(string ilSpyExe, string message, bool activate)
{
+ string expectedProcessName = Path.GetFileNameWithoutExtension(ilSpyExe);
// We wait asynchronously until target window can be found and try to find it multiple times
Task.Run(async () => {
bool success = false;
@@ -66,14 +67,17 @@ namespace ICSharpCode.ILSpy.AddIn
(hWnd, lParam) => {
string windowTitle = NativeMethods.GetWindowText(hWnd, 100);
if (windowTitle.StartsWith("ILSpy", StringComparison.Ordinal)) {
- Debug.WriteLine("Found {0:x4}: {1}", hWnd, windowTitle);
- IntPtr result = Send(hWnd, message);
- Debug.WriteLine("WM_COPYDATA result: {0:x8}", result);
- if (result == (IntPtr)1) {
- if (activate)
- NativeMethods.SetForegroundWindow(hWnd);
- success = true;
- return false; // stop enumeration
+ string processName = NativeMethods.GetProcessNameFromWindow(hWnd);
+ Debug.WriteLine("Found {0:x4}: '{1}' in '{2}'", hWnd, windowTitle, processName);
+ if (string.Equals(processName, expectedProcessName, StringComparison.OrdinalIgnoreCase)) {
+ IntPtr result = Send(hWnd, message);
+ Debug.WriteLine("WM_COPYDATA result: {0:x8}", result);
+ if (result == (IntPtr)1) {
+ if (activate)
+ NativeMethods.SetForegroundWindow(hWnd);
+ success = true;
+ return false; // stop enumeration
+ }
}
}
return true; // continue enumeration
diff --git a/ILSpy.AddIn/Properties/AssemblyInfo.cs b/ILSpy.AddIn/Properties/AssemblyInfo.cs
index db36e8d59..64f95fad1 100644
--- a/ILSpy.AddIn/Properties/AssemblyInfo.cs
+++ b/ILSpy.AddIn/Properties/AssemblyInfo.cs
@@ -1,5 +1,6 @@
using System;
using System.Reflection;
+using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -11,6 +12,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(false)]
-
+[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: InternalsVisibleTo("ILSpy.AddIn_IntegrationTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100653c4a319be4f524972c3c5bba5fd243330f8e900287d9022d7821a63fd0086fd3801e3683dbe9897f2ecc44727023e9b40adcf180730af70c81c54476b3e5ba8b0f07f5132b2c3cc54347a2c1a9d64ebaaaf3cbffc1a18c427981e2a51d53d5ab02536b7550e732f795121c38a0abfdb38596353525d034baf9e6f1fd8ac4ac")]
[assembly: InternalsVisibleTo("ILSpy.AddIn_UnitTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100653c4a319be4f524972c3c5bba5fd243330f8e900287d9022d7821a63fd0086fd3801e3683dbe9897f2ecc44727023e9b40adcf180730af70c81c54476b3e5ba8b0f07f5132b2c3cc54347a2c1a9d64ebaaaf3cbffc1a18c427981e2a51d53d5ab02536b7550e732f795121c38a0abfdb38596353525d034baf9e6f1fd8ac4ac")]
diff --git a/ILSpy.AddIn/Utils.cs b/ILSpy.AddIn/Utils.cs
index 74af2d797..65d3dc4b0 100644
--- a/ILSpy.AddIn/Utils.cs
+++ b/ILSpy.AddIn/Utils.cs
@@ -30,101 +30,6 @@ namespace ICSharpCode.ILSpy.AddIn
static 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
- ///
- /// Decodes a command line into an array of arguments according to the CommandLineToArgvW rules.
- ///
- ///
- /// 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.
- ///
- 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', '"' };
-
- ///
- /// Escapes a set of arguments according to the CommandLineToArgvW rules.
- ///
- ///
- /// 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.
- ///
- 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 == null) {
- return;
- }
-
- 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
-
public static byte[] HexStringToBytes(string hex)
{
if (hex == null)
diff --git a/ILSpy.AddIn/VSPackage.en-US.resx b/ILSpy.AddIn/VSPackage.en-US.resx
new file mode 100644
index 000000000..73c158134
--- /dev/null
+++ b/ILSpy.AddIn/VSPackage.en-US.resx
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ ILSpy.AddIn
+
+
+ Integration of the ILSpy Decompiler into Visual Studio.
+
+
\ No newline at end of file
diff --git a/ILSpy.AddIn/VSPackage.zh-Hans.resx b/ILSpy.AddIn/VSPackage.zh-Hans.resx
new file mode 100644
index 000000000..db43f348a
--- /dev/null
+++ b/ILSpy.AddIn/VSPackage.zh-Hans.resx
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ ILSpy.AddIn
+
+
+ 可以在 Visual Studio 中直接打开反编译工具 ILSpy 。
+
+
\ No newline at end of file
diff --git a/ILSpy.AddIn/zh-Hans/extension.vsixlangpack b/ILSpy.AddIn/zh-Hans/extension.vsixlangpack
new file mode 100644
index 000000000..c650a50a2
--- /dev/null
+++ b/ILSpy.AddIn/zh-Hans/extension.vsixlangpack
@@ -0,0 +1,7 @@
+
+
+
+ ILSpy
+ 可以在 Visual Studio 中直接打开反编译工具 ILSpy 。
+
+
\ No newline at end of file
diff --git a/ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj b/ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj
index aacd89197..9e27fa5b5 100644
--- a/ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj
+++ b/ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj
@@ -1,6 +1,5 @@
-
-
+
net472
@@ -8,8 +7,11 @@
8.0
False
-
+ en-US
false
+ true
+ false
+ false
@@ -44,6 +46,12 @@
+
+
+ True
+ True
+ Resources.resx
+
ReadyToRunOptionPage.xaml
@@ -51,6 +59,16 @@
+
+
+ PublicResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+
+
+
@@ -60,8 +78,6 @@
-
-
diff --git a/ILSpy.ReadyToRun/Properties/AssemblyInfo.cs b/ILSpy.ReadyToRun/Properties/AssemblyInfo.cs
index 85918694e..cd1bac780 100644
--- a/ILSpy.ReadyToRun/Properties/AssemblyInfo.cs
+++ b/ILSpy.ReadyToRun/Properties/AssemblyInfo.cs
@@ -1,33 +1,10 @@
-#region Using directives
-
+using System;
using System.Reflection;
-using System.Runtime.InteropServices;
+using System.Resources;
using System.Runtime.CompilerServices;
-
-#endregion
+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.ReadyToRun.Plugin")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ILSpy.ReadyToRun.Plugin")]
-[assembly: AssemblyCopyright("Copyright 2011")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// This sets the default COM visibility of types in the assembly to invisible.
-// If you need to expose a type to COM, use [ComVisible(true)] on that type.
-[assembly: ComVisible(false)]
-
-[assembly: InternalsVisibleTo("ILSpy.ReadyToRun.Tests")]
-
-// The assembly version has following format :
-//
-// Major.Minor.Build.Revision
-//
-// You can specify all the values or you can use the default the Revision and
-// Build Numbers by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: NeutralResourcesLanguage("en-US")]
diff --git a/ILSpy.ReadyToRun/Properties/Resources.Designer.cs b/ILSpy.ReadyToRun/Properties/Resources.Designer.cs
new file mode 100644
index 000000000..56cf7ac1f
--- /dev/null
+++ b/ILSpy.ReadyToRun/Properties/Resources.Designer.cs
@@ -0,0 +1,99 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本:4.0.30319.42000
+//
+// 对此文件的更改可能会导致不正确的行为,并且如果
+// 重新生成代码,这些更改将会丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace ILSpy.ReadyToRun.Properties {
+ using System;
+
+
+ ///
+ /// 一个强类型的资源类,用于查找本地化的字符串等。
+ ///
+ // 此类是由 StronglyTypedResourceBuilder
+ // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+ // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // (以 /str 作为命令选项),或重新生成 VS 项目。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ public 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() {
+ }
+
+ ///
+ /// 返回此类使用的缓存的 ResourceManager 实例。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ILSpy.ReadyToRun.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 重写当前线程的 CurrentUICulture 属性
+ /// 重写当前线程的 CurrentUICulture 属性。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// 查找类似 Disassembly Format 的本地化字符串。
+ ///
+ public static string DisassemblyFormat {
+ get {
+ return ResourceManager.GetString("DisassemblyFormat", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 ReadyToRun 的本地化字符串。
+ ///
+ public static string ReadyToRun {
+ get {
+ return ResourceManager.GetString("ReadyToRun", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Show Debug Info 的本地化字符串。
+ ///
+ public static string ShowDebugInfo {
+ get {
+ return ResourceManager.GetString("ShowDebugInfo", resourceCulture);
+ }
+ }
+
+ ///
+ /// 查找类似 Show Unwind Info 的本地化字符串。
+ ///
+ public static string ShowUnwindInfo {
+ get {
+ return ResourceManager.GetString("ShowUnwindInfo", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/ILSpy.ReadyToRun/Properties/Resources.resx b/ILSpy.ReadyToRun/Properties/Resources.resx
new file mode 100644
index 000000000..8c6d1ce8c
--- /dev/null
+++ b/ILSpy.ReadyToRun/Properties/Resources.resx
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Disassembly Format
+
+
+ ReadyToRun
+
+
+ Show Debug Info
+
+
+ Show Unwind Info
+
+
\ No newline at end of file
diff --git a/ILSpy.ReadyToRun/Properties/Resources.zh-Hans.resx b/ILSpy.ReadyToRun/Properties/Resources.zh-Hans.resx
new file mode 100644
index 000000000..9430c8a3d
--- /dev/null
+++ b/ILSpy.ReadyToRun/Properties/Resources.zh-Hans.resx
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 反汇编格式
+
+
+ ReadyToRun
+
+
+ 显示调试信息
+
+
+ 显示展开信息
+
+
\ No newline at end of file
diff --git a/ILSpy.ReadyToRun/ReadyToRunLanguage.cs b/ILSpy.ReadyToRun/ReadyToRunLanguage.cs
index bcf830831..2d6271028 100644
--- a/ILSpy.ReadyToRun/ReadyToRunLanguage.cs
+++ b/ILSpy.ReadyToRun/ReadyToRunLanguage.cs
@@ -24,9 +24,9 @@ using System.Linq;
using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335;
using System.Reflection.PortableExecutable;
+using System.Resources;
using System.Runtime.CompilerServices;
using Iced.Intel;
-
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.IL;
diff --git a/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml b/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml
index 7fb149cbe..c11450ef7 100644
--- a/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml
+++ b/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml
@@ -1,5 +1,6 @@
@@ -11,11 +12,11 @@
- Disassembly Format
+
- Show Unwind Info
+
- Show Debug Info
+
\ No newline at end of file
diff --git a/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml.cs b/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml.cs
index 3bf810d85..7abcb69a1 100644
--- a/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml.cs
+++ b/ILSpy.ReadyToRun/ReadyToRunOptionPage.xaml.cs
@@ -20,10 +20,10 @@ using System.ComponentModel;
using System.Windows.Controls;
using System.Xml.Linq;
using ICSharpCode.ILSpy.Options;
-
+using ILSpy.ReadyToRun;
namespace ICSharpCode.ILSpy.ReadyToRun
{
- [ExportOptionPage(Title = "ReadyToRun", Order = 40)]
+ [ExportOptionPage(Title = nameof(global::ILSpy.ReadyToRun.Properties.Resources.ReadyToRun), Order = 40)]
partial class ReadyToRunOptionPage : UserControl, IOptionPage
{
public ReadyToRunOptionPage()
diff --git a/ILSpy.Tests/ILSpy.Tests.csproj b/ILSpy.Tests/ILSpy.Tests.csproj
index 8dc71b75d..fb4a483a6 100644
--- a/ILSpy.Tests/ILSpy.Tests.csproj
+++ b/ILSpy.Tests/ILSpy.Tests.csproj
@@ -46,8 +46,8 @@
-
-
+
+
diff --git a/ILSpy/AboutPage.cs b/ILSpy/AboutPage.cs
index e904de4a8..1916abee5 100644
--- a/ILSpy/AboutPage.cs
+++ b/ILSpy/AboutPage.cs
@@ -88,7 +88,7 @@ namespace ICSharpCode.ILSpy
plugin.Write(output);
output.WriteLine();
output.Address = new Uri("resource://AboutPage");
- using (Stream s = typeof(AboutPage).Assembly.GetManifestResourceStream(typeof(AboutPage), "ILSpyAboutPage.txt")) {
+ using (Stream s = typeof(AboutPage).Assembly.GetManifestResourceStream(typeof(AboutPage), Resources.ILSpyAboutPageTxt)) {
using (StreamReader r = new StreamReader(s)) {
string line;
while ((line = r.ReadLine()) != null) {
diff --git a/ILSpy/App.xaml.cs b/ILSpy/App.xaml.cs
index 5d5f5e36b..2fa17861a 100644
--- a/ILSpy/App.xaml.cs
+++ b/ILSpy/App.xaml.cs
@@ -165,6 +165,9 @@ namespace ICSharpCode.ILSpy
}
}
+ [ThreadStatic]
+ static bool showingError;
+
static void UnhandledException(Exception exception)
{
Debug.WriteLine(exception.ToString());
@@ -176,26 +179,44 @@ namespace ICSharpCode.ILSpy
break;
}
}
- MessageBox.Show(exception.ToString(), "Sorry, we crashed");
+ if (showingError) {
+ // Ignore re-entrant calls
+ // We run the risk of opening an infinite number of exception dialogs.
+ return;
+ }
+ showingError = true;
+ try {
+ MessageBox.Show(exception.ToString(), "Sorry, we crashed");
+ } finally {
+ showingError = false;
+ }
}
#endregion
#region Pass Command Line Arguments to previous instance
bool SendToPreviousInstance(string message, bool activate)
{
+ string ownProcessName;
+ using (var ownProcess = Process.GetCurrentProcess()) {
+ ownProcessName = ownProcess.ProcessName;
+ }
+
bool success = false;
NativeMethods.EnumWindows(
(hWnd, lParam) => {
string windowTitle = NativeMethods.GetWindowText(hWnd, 100);
if (windowTitle.StartsWith("ILSpy", StringComparison.Ordinal)) {
- Debug.WriteLine("Found {0:x4}: {1}", hWnd, windowTitle);
- IntPtr result = Send(hWnd, message);
- Debug.WriteLine("WM_COPYDATA result: {0:x8}", result);
- if (result == (IntPtr)1) {
- if (activate)
- NativeMethods.SetForegroundWindow(hWnd);
- success = true;
- return false; // stop enumeration
+ string processName = NativeMethods.GetProcessNameFromWindow(hWnd);
+ Debug.WriteLine("Found {0:x4}: '{1}' in '{2}'", hWnd, windowTitle, processName);
+ if (string.Equals(processName, ownProcessName, StringComparison.OrdinalIgnoreCase)) {
+ IntPtr result = Send(hWnd, message);
+ Debug.WriteLine("WM_COPYDATA result: {0:x8}", result);
+ if (result == (IntPtr)1) {
+ if (activate)
+ NativeMethods.SetForegroundWindow(hWnd);
+ success = true;
+ return false; // stop enumeration
+ }
}
}
return true; // continue enumeration
diff --git a/ILSpy/Commands/DecompileAllCommand.cs b/ILSpy/Commands/DecompileAllCommand.cs
index ac263edf7..56a698e33 100644
--- a/ILSpy/Commands/DecompileAllCommand.cs
+++ b/ILSpy/Commands/DecompileAllCommand.cs
@@ -19,6 +19,7 @@
#if DEBUG
using System;
+using System.Collections.Concurrent;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
@@ -40,29 +41,32 @@ namespace ICSharpCode.ILSpy
{
Docking.DockWorkspace.Instance.RunWithCancellation(ct => Task.Factory.StartNew(() => {
AvalonEditTextOutput output = new AvalonEditTextOutput();
- Parallel.ForEach(MainWindow.Instance.CurrentAssemblyList.GetAssemblies(), new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount, CancellationToken = ct }, delegate(LoadedAssembly asm) {
- if (!asm.HasLoadError) {
- Stopwatch w = Stopwatch.StartNew();
- Exception exception = null;
- using (var writer = new System.IO.StreamWriter("c:\\temp\\decompiled\\" + asm.ShortName + ".cs")) {
- try {
- new CSharpLanguage().DecompileAssembly(asm, new Decompiler.PlainTextOutput(writer), new DecompilationOptions() { FullDecompilation = true, CancellationToken = ct });
+ Parallel.ForEach(
+ Partitioner.Create( MainWindow.Instance.CurrentAssemblyList.GetAssemblies(), loadBalance: true),
+ new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount, CancellationToken = ct },
+ delegate(LoadedAssembly asm) {
+ if (!asm.HasLoadError) {
+ Stopwatch w = Stopwatch.StartNew();
+ Exception exception = null;
+ using (var writer = new System.IO.StreamWriter("c:\\temp\\decompiled\\" + asm.ShortName + ".cs")) {
+ try {
+ new CSharpLanguage().DecompileAssembly(asm, new Decompiler.PlainTextOutput(writer), new DecompilationOptions() { FullDecompilation = true, CancellationToken = ct });
+ }
+ catch (Exception ex) {
+ writer.WriteLine(ex.ToString());
+ exception = ex;
+ }
}
- catch (Exception ex) {
- writer.WriteLine(ex.ToString());
- exception = ex;
+ lock (output) {
+ output.Write(asm.ShortName + " - " + w.Elapsed);
+ if (exception != null) {
+ output.Write(" - ");
+ output.Write(exception.GetType().Name);
+ }
+ output.WriteLine();
}
}
- lock (output) {
- output.Write(asm.ShortName + " - " + w.Elapsed);
- if (exception != null) {
- output.Write(" - ");
- output.Write(exception.GetType().Name);
- }
- output.WriteLine();
- }
- }
- });
+ });
return output;
}, ct)).Then(output => Docking.DockWorkspace.Instance.ShowText(output)).HandleExceptions();
}
diff --git a/ILSpy/Commands/DecompileCommand.cs b/ILSpy/Commands/DecompileCommand.cs
index 24c6c4180..d9485e512 100644
--- a/ILSpy/Commands/DecompileCommand.cs
+++ b/ILSpy/Commands/DecompileCommand.cs
@@ -24,11 +24,12 @@ using System.Windows.Controls;
using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpy.Metadata;
+using ICSharpCode.ILSpy.Properties;
using ICSharpCode.ILSpy.TreeNodes;
namespace ICSharpCode.ILSpy.Commands
{
- [ExportContextMenuEntry(Header = "Decompile", Order = 10)]
+ [ExportContextMenuEntry(Header = nameof(Resources.Decompile), Order = 10)]
class DecompileCommand : IContextMenuEntry
{
public bool IsVisible(TextViewContext context)
@@ -68,7 +69,7 @@ namespace ICSharpCode.ILSpy.Commands
}
}
- [ExportContextMenuEntry(Header = "Go to token", Order = 10)]
+ [ExportContextMenuEntry(Header = nameof(Resources.GoToToken), Order = 10)]
class GoToToken : IContextMenuEntry
{
public void Execute(TextViewContext context)
diff --git a/ILSpy/Commands/DisassembleAllCommand.cs b/ILSpy/Commands/DisassembleAllCommand.cs
index 23319be78..e220ead0c 100644
--- a/ILSpy/Commands/DisassembleAllCommand.cs
+++ b/ILSpy/Commands/DisassembleAllCommand.cs
@@ -23,6 +23,8 @@ using System.Diagnostics;
using System.Threading.Tasks;
using ICSharpCode.ILSpy.TextView;
using ICSharpCode.ILSpy.Properties;
+using System.Collections.Concurrent;
+
namespace ICSharpCode.ILSpy
{
[ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources.DEBUGDisassemble), MenuCategory = nameof(Resources.Open), MenuOrder = 2.5)]
@@ -37,8 +39,11 @@ namespace ICSharpCode.ILSpy
{
Docking.DockWorkspace.Instance.RunWithCancellation(ct => Task.Factory.StartNew(() => {
AvalonEditTextOutput output = new AvalonEditTextOutput();
- Parallel.ForEach(MainWindow.Instance.CurrentAssemblyList.GetAssemblies(), new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount, CancellationToken = ct }, delegate(LoadedAssembly asm) {
- if (!asm.HasLoadError) {
+ Parallel.ForEach(
+ Partitioner.Create(MainWindow.Instance.CurrentAssemblyList.GetAssemblies(), loadBalance: true),
+ new ParallelOptions { MaxDegreeOfParallelism = Environment.ProcessorCount, CancellationToken = ct },
+ delegate (LoadedAssembly asm) {
+ if (!asm.HasLoadError) {
Stopwatch w = Stopwatch.StartNew();
Exception exception = null;
using (var writer = new System.IO.StreamWriter("c:\\temp\\disassembled\\" + asm.Text.Replace("(", "").Replace(")", "").Replace(' ', '_') + ".il")) {
diff --git a/ILSpy/Commands/GeneratePdbContextMenuEntry.cs b/ILSpy/Commands/GeneratePdbContextMenuEntry.cs
index 9bea8740e..36330fefa 100644
--- a/ILSpy/Commands/GeneratePdbContextMenuEntry.cs
+++ b/ILSpy/Commands/GeneratePdbContextMenuEntry.cs
@@ -32,7 +32,7 @@ using ICSharpCode.ILSpy.Properties;
namespace ICSharpCode.ILSpy
{
- [ExportContextMenuEntry(Header = "Generate portable PDB")]
+ [ExportContextMenuEntry(Header = nameof(Resources.GeneratePortable))]
class GeneratePdbContextMenuEntry : IContextMenuEntry
{
public void Execute(TextViewContext context)
@@ -55,12 +55,12 @@ namespace ICSharpCode.ILSpy
{
var file = assembly.GetPEFileOrNull();
if (!PortablePdbWriter.HasCodeViewDebugDirectoryEntry(file)) {
- MessageBox.Show($"Cannot create PDB file for {Path.GetFileName(assembly.FileName)}, because it does not contain a PE Debug Directory Entry of type 'CodeView'.");
+ MessageBox.Show(string.Format(Resources.CannotCreatePDBFile, Path.GetFileName(assembly.FileName)));
return;
}
SaveFileDialog dlg = new SaveFileDialog();
dlg.FileName = DecompilerTextView.CleanUpName(assembly.ShortName) + ".pdb";
- dlg.Filter = "Portable PDB|*.pdb|All files|*.*";
+ dlg.Filter = Resources.PortablePDBPdbAllFiles;
dlg.InitialDirectory = Path.GetDirectoryName(assembly.FileName);
if (dlg.ShowDialog() != true) return;
DecompilationOptions options = new DecompilationOptions();
@@ -74,21 +74,21 @@ namespace ICSharpCode.ILSpy
PortablePdbWriter.WritePdb(file, decompiler, options.DecompilerSettings, stream);
} catch (OperationCanceledException) {
output.WriteLine();
- output.WriteLine("Generation was cancelled.");
+ output.WriteLine(Resources.GenerationWasCancelled);
throw;
}
}
stopwatch.Stop();
- output.WriteLine("Generation complete in " + stopwatch.Elapsed.TotalSeconds.ToString("F1") + " seconds.");
+ output.WriteLine(string.Format(Resources.GenerationCompleteInSeconds, stopwatch.Elapsed.TotalSeconds.ToString("F1")));
output.WriteLine();
- output.AddButton(null, "Open Explorer", delegate { Process.Start("explorer", "/select,\"" + fileName + "\""); });
+ output.AddButton(null, Resources.OpenExplorer, delegate { Process.Start("explorer", "/select,\"" + fileName + "\""); });
output.WriteLine();
return output;
}, ct)).Then(output => Docking.DockWorkspace.Instance.ShowText(output)).HandleExceptions();
}
}
- [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources.GeneratePortable), MenuCategory = "Save")]
+ [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources.GeneratePortable), MenuCategory = nameof(Resources.Save))]
class GeneratePdbMainMenuEntry : SimpleCommand
{
public override bool CanExecute(object parameter)
diff --git a/ILSpy/Commands/ManageAssemblyListsCommand.cs b/ILSpy/Commands/ManageAssemblyListsCommand.cs
index 49effa4a7..10ba404d2 100644
--- a/ILSpy/Commands/ManageAssemblyListsCommand.cs
+++ b/ILSpy/Commands/ManageAssemblyListsCommand.cs
@@ -21,7 +21,7 @@ using ICSharpCode.ILSpy.Properties;
namespace ICSharpCode.ILSpy
{
- [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources.ManageAssemblyLists), MenuIcon = "Images/AssemblyList", MenuCategory = nameof(Resources.Open), MenuOrder = 1.7)]
+ [ExportMainMenuCommand(Menu = nameof(Resources._File), Header = nameof(Resources.ManageAssembly_Lists), MenuIcon = "Images/AssemblyList", MenuCategory = nameof(Resources.Open), MenuOrder = 1.7)]
sealed class ManageAssemblyListsCommand : SimpleCommand
{
public override void Execute(object parameter)
diff --git a/ILSpy/Commands/Pdb2XmlCommand.cs b/ILSpy/Commands/Pdb2XmlCommand.cs
index 91b481f7b..13856e8b0 100644
--- a/ILSpy/Commands/Pdb2XmlCommand.cs
+++ b/ILSpy/Commands/Pdb2XmlCommand.cs
@@ -24,13 +24,14 @@ using System.Linq;
using System.Threading.Tasks;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.Decompiler;
+using ICSharpCode.ILSpy.Properties;
using ICSharpCode.ILSpy.TextView;
using ICSharpCode.ILSpy.TreeNodes;
using Microsoft.DiaSymReader.Tools;
namespace ICSharpCode.ILSpy
{
- [ExportMainMenuCommand(Menu = "_File", Header = "DEBUG -- Dump PDB as XML", MenuCategory = "Open", MenuOrder = 2.6)]
+ [ExportMainMenuCommand(Menu = nameof(Resources._File) , Header = nameof(Resources.DEBUGDumpPDBAsXML), MenuCategory = nameof(Resources.Open), MenuOrder = 2.6)]
sealed class Pdb2XmlCommand : SimpleCommand
{
public override bool CanExecute(object parameter)
@@ -64,7 +65,7 @@ namespace ICSharpCode.ILSpy
}
}
- [ExportContextMenuEntry(Header = "DEBUG -- Dump PDB as XML")]
+ [ExportContextMenuEntry(Header = nameof(Resources.DEBUGDumpPDBAsXML))]
class Pdb2XmlCommandContextMenuEntry : IContextMenuEntry
{
public void Execute(TextViewContext context)
diff --git a/ILSpy/Commands/SaveCodeContextMenuEntry.cs b/ILSpy/Commands/SaveCodeContextMenuEntry.cs
index 84282eaa2..c54a2ba7b 100644
--- a/ILSpy/Commands/SaveCodeContextMenuEntry.cs
+++ b/ILSpy/Commands/SaveCodeContextMenuEntry.cs
@@ -93,7 +93,7 @@ namespace ICSharpCode.ILSpy.TextView
{
SaveFileDialog dlg = new SaveFileDialog();
dlg.FileName = "Solution.sln";
- dlg.Filter = "Visual Studio Solution file|*.sln|All files|*.*";
+ dlg.Filter = Resources.VisualStudioSolutionFileSlnAllFiles;
if (dlg.ShowDialog() != true) {
return null;
diff --git a/ILSpy/Commands/SelectPdbContextMenuEntry.cs b/ILSpy/Commands/SelectPdbContextMenuEntry.cs
index 3303ca15c..b538ad708 100644
--- a/ILSpy/Commands/SelectPdbContextMenuEntry.cs
+++ b/ILSpy/Commands/SelectPdbContextMenuEntry.cs
@@ -18,12 +18,13 @@
using System.IO;
using System.Linq;
+using ICSharpCode.ILSpy.Properties;
using ICSharpCode.ILSpy.TextView;
using ICSharpCode.ILSpy.TreeNodes;
using Microsoft.Win32;
namespace ICSharpCode.ILSpy
{
- [ExportContextMenuEntry(Header = "Select PDB...")]
+ [ExportContextMenuEntry(Header = nameof(Resources.SelectPDB))]
class SelectPdbContextMenuEntry : IContextMenuEntry
{
public void Execute(TextViewContext context)
@@ -32,7 +33,7 @@ namespace ICSharpCode.ILSpy
if (assembly == null) return;
OpenFileDialog dlg = new OpenFileDialog();
dlg.FileName = DecompilerTextView.CleanUpName(assembly.ShortName) + ".pdb";
- dlg.Filter = "Portable PDB|*.pdb|All files|*.*";
+ dlg.Filter = Resources.PortablePDBPdbAllFiles;
dlg.InitialDirectory = Path.GetDirectoryName(assembly.FileName);
if (dlg.ShowDialog() != true) return;
diff --git a/ILSpy/ILSpy.csproj b/ILSpy/ILSpy.csproj
index 71414747b..197bd9ed7 100644
--- a/ILSpy/ILSpy.csproj
+++ b/ILSpy/ILSpy.csproj
@@ -128,9 +128,7 @@
-
- Form
-
+
@@ -457,6 +455,7 @@
+
license.txt
@@ -845,7 +844,14 @@
-
+
+
+
+ powershell -NoProfile -ExecutionPolicy Bypass -File BuildTools/sort-resx.ps1
+
+
+
+
diff --git a/ILSpy/Languages/CSharpHighlightingTokenWriter.cs b/ILSpy/Languages/CSharpHighlightingTokenWriter.cs
index 6845088a3..f588cd153 100644
--- a/ILSpy/Languages/CSharpHighlightingTokenWriter.cs
+++ b/ILSpy/Languages/CSharpHighlightingTokenWriter.cs
@@ -184,8 +184,10 @@ namespace ICSharpCode.ILSpy
case "set":
case "add":
case "remove":
+ case "init":
if (role == PropertyDeclaration.GetKeywordRole ||
role == PropertyDeclaration.SetKeywordRole ||
+ role == PropertyDeclaration.InitKeywordRole ||
role == CustomEventDeclaration.AddKeywordRole ||
role == CustomEventDeclaration.RemoveKeywordRole)
color = accessorKeywordsColor;
diff --git a/ILSpy/Languages/CSharpLanguage.cs b/ILSpy/Languages/CSharpLanguage.cs
index 8b0253026..96c22ce91 100644
--- a/ILSpy/Languages/CSharpLanguage.cs
+++ b/ILSpy/Languages/CSharpLanguage.cs
@@ -648,6 +648,9 @@ namespace ICSharpCode.ILSpy
if (!settings.LiftNullables) {
flags &= ~ConversionFlags.UseNullableSpecifierForValueTypes;
}
+ if (entity is IMethod m && m.IsLocalFunction) {
+ writer.WriteIdentifier(Identifier.Create("(local)"));
+ }
new CSharpAmbience() {
ConversionFlags = flags,
}.ConvertSymbol(entity, writer, settings.CSharpFormattingOptions);
diff --git a/ILSpy/LoadedAssembly.cs b/ILSpy/LoadedAssembly.cs
index fc0e1bcdc..60c37eefe 100644
--- a/ILSpy/LoadedAssembly.cs
+++ b/ILSpy/LoadedAssembly.cs
@@ -20,17 +20,21 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
+using System.Linq;
using System.Reflection.Metadata;
using System.Reflection.PortableExecutable;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
+using System.Windows.Threading;
+
using ICSharpCode.Decompiler.DebugInfo;
using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.PdbProvider;
using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.Decompiler.TypeSystem.Implementation;
+using ICSharpCode.Decompiler.Util;
using ICSharpCode.ILSpy.Options;
namespace ICSharpCode.ILSpy
@@ -318,6 +322,17 @@ namespace ICSharpCode.ILSpy
static readonly Dictionary loadingAssemblies = new Dictionary();
MyUniversalResolver universalResolver;
+ ///
+ /// 1) try to find exact match by tfm + full asm name in loaded assemblies
+ /// 2) try to find match in search paths
+ /// 3) if a.deps.json is found: search %USERPROFILE%/.nuget/packages/* as well
+ /// 4) look in /dotnet/shared/{runtime-pack}/{closest-version}
+ /// 5) if the version is retargetable or all zeros or ones, search C:\Windows\Microsoft.NET\Framework64\v4.0.30319
+ /// 6) For "mscorlib.dll" we use the exact same assembly with which ILSpy runs
+ /// 7) Search the GAC
+ /// 8) search C:\Windows\Microsoft.NET\Framework64\v4.0.30319
+ /// 9) try to find match by asm name (no tfm/version) in loaded assemblies
+ ///
LoadedAssembly LookupReferencedAssemblyInternal(IAssemblyReference fullName, bool isWinRT, string tfm)
{
string key = tfm + ";" + (isWinRT ? fullName.Name : fullName.FullName);
@@ -359,8 +374,29 @@ namespace ICSharpCode.ILSpy
LoadedAssemblyReferencesInfo.AddMessage(fullName.ToString(), MessageKind.Info, "Success - Loading from: " + file);
asm = new LoadedAssembly(assemblyList, file) { IsAutoLoaded = true };
} else {
- LoadedAssemblyReferencesInfo.AddMessageOnce(fullName.ToString(), MessageKind.Error, "Could not find reference: " + fullName);
- return null;
+ var candidates = new List<(LoadedAssembly assembly, Version version)>();
+
+ foreach (LoadedAssembly loaded in assemblyList.GetAssemblies()) {
+ var module = loaded.GetPEFileOrNull();
+ var reader = module?.Metadata;
+ if (reader == null || !reader.IsAssembly) continue;
+ var asmDef = reader.GetAssemblyDefinition();
+ var asmDefName = reader.GetString(asmDef.Name);
+ if (fullName.Name.Equals(asmDefName, StringComparison.OrdinalIgnoreCase)) {
+ candidates.Add((loaded, asmDef.Version));
+ }
+ }
+
+ if (candidates.Count == 0) {
+ LoadedAssemblyReferencesInfo.AddMessageOnce(fullName.ToString(), MessageKind.Error, "Could not find reference: " + fullName);
+ return null;
+ }
+
+ candidates.SortBy(c => c.version);
+
+ var bestCandidate = candidates.FirstOrDefault(c => c.version >= fullName.Version).assembly ?? candidates.Last().assembly;
+ LoadedAssemblyReferencesInfo.AddMessageOnce(fullName.ToString(), MessageKind.Info, "Success - Found in Assembly List with different TFM or version: " + bestCandidate.fileName);
+ return bestCandidate;
}
loadingAssemblies.Add(file, asm);
}
@@ -371,7 +407,7 @@ namespace ICSharpCode.ILSpy
lock (loadingAssemblies) {
loadingAssemblies.Remove(file);
}
- });
+ }, DispatcherPriority.Normal);
return asm;
}
diff --git a/ILSpy/MainWindow.xaml.cs b/ILSpy/MainWindow.xaml.cs
index 9e03b263c..10bd97d47 100644
--- a/ILSpy/MainWindow.xaml.cs
+++ b/ILSpy/MainWindow.xaml.cs
@@ -408,6 +408,9 @@ namespace ICSharpCode.ILSpy
found = true;
} else {
IEntity mr = await Task.Run(() => FindEntityInRelevantAssemblies(navigateTo, relevantAssemblies));
+ // Make sure we wait for assemblies being loaded...
+ // BeginInvoke in LoadedAssembly.LookupReferencedAssemblyInternal
+ await Dispatcher.InvokeAsync(delegate { }, DispatcherPriority.Normal);
if (mr != null && mr.ParentModule.PEFile != null) {
found = true;
if (AssemblyTreeView.SelectedItem == initialSelection) {
@@ -483,6 +486,12 @@ namespace ICSharpCode.ILSpy
return false;
}
+ // We intentionally ignore reference assemblies, so that the loop continues looking for another assembly that might have a usable definition.
+ if (module.IsReferenceAssembly()) {
+ typeHandle = default;
+ return false;
+ }
+
switch (typeRef) {
case GetPotentiallyNestedClassTypeReference topLevelType:
typeHandle = topLevelType.ResolveInPEFile(module);
diff --git a/ILSpy/Metadata/Helpers.cs b/ILSpy/Metadata/Helpers.cs
index 38f69d30d..6321f8ee3 100644
--- a/ILSpy/Metadata/Helpers.cs
+++ b/ILSpy/Metadata/Helpers.cs
@@ -113,6 +113,7 @@ namespace ICSharpCode.ILSpy.Metadata
};
switch (e.PropertyName) {
case "RID":
+ case "Meaning":
e.Column.SetTemplate((ControlTemplate)MetadataTableViews.Instance["DefaultFilter"]);
((DataGridCustomTextColumn)e.Column).ToolTipBinding = null;
break;
diff --git a/ILSpy/NativeMethods.cs b/ILSpy/NativeMethods.cs
index 9487743d6..3805f3a23 100644
--- a/ILSpy/NativeMethods.cs
+++ b/ILSpy/NativeMethods.cs
@@ -20,20 +20,24 @@ using System;
using System.Text;
using System.Runtime.InteropServices;
using System.ComponentModel;
+using System.Diagnostics;
namespace ICSharpCode.ILSpy
{
static class NativeMethods
{
public const uint WM_COPYDATA = 0x4a;
-
+
[DllImport("user32.dll", CharSet = CharSet.Auto)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
-
+
+ [DllImport("user32.dll", CharSet = CharSet.Auto)]
+ internal static extern unsafe int GetWindowThreadProcessId(IntPtr hWnd, int* lpdwProcessId);
+
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern int GetWindowText(IntPtr hWnd, [Out] StringBuilder title, int size);
-
+
public static string GetWindowText(IntPtr hWnd, int maxLength)
{
StringBuilder b = new StringBuilder(maxLength + 1);
@@ -42,12 +46,12 @@ namespace ICSharpCode.ILSpy
else
return string.Empty;
}
-
+
[DllImport("user32.dll", CharSet = CharSet.Auto)]
internal static extern IntPtr SendMessageTimeout(
IntPtr hWnd, uint msg, IntPtr wParam, ref CopyDataStruct lParam,
uint flags, uint timeout, out IntPtr result);
-
+
[DllImport("user32.dll", CharSet = CharSet.Auto)]
[return: MarshalAs(UnmanagedType.Bool)]
internal static extern bool SetForegroundWindow(IntPtr hWnd);
@@ -145,11 +149,31 @@ namespace ICSharpCode.ILSpy
}
}
#endregion
+
+ public unsafe static string GetProcessNameFromWindow(IntPtr hWnd)
+ {
+ int processId;
+ GetWindowThreadProcessId(hWnd, &processId);
+ try {
+ using (var p = Process.GetProcessById(processId)) {
+ return p.ProcessName;
+ }
+ } catch (ArgumentException ex) {
+ Debug.WriteLine(ex.Message);
+ return null;
+ } catch (InvalidOperationException ex) {
+ Debug.WriteLine(ex.Message);
+ return null;
+ } catch (Win32Exception ex) {
+ Debug.WriteLine(ex.Message);
+ return null;
+ }
+ }
}
[return: MarshalAs(UnmanagedType.Bool)]
delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
-
+
[StructLayout(LayoutKind.Sequential)]
struct CopyDataStruct
{
diff --git a/ILSpy/Properties/AssemblyInfo.template.cs b/ILSpy/Properties/AssemblyInfo.template.cs
index ac72179e6..e564bd6b8 100644
--- a/ILSpy/Properties/AssemblyInfo.template.cs
+++ b/ILSpy/Properties/AssemblyInfo.template.cs
@@ -37,7 +37,7 @@ using System.Diagnostics.CodeAnalysis;
internal static class RevisionClass
{
public const string Major = "6";
- public const string Minor = "0";
+ public const string Minor = "1";
public const string Build = "0";
public const string Revision = "$INSERTREVISION$";
public const string VersionName = null;
diff --git a/ILSpy/Properties/Resources.Designer.cs b/ILSpy/Properties/Resources.Designer.cs
index 84a05cf4c..32289de3d 100644
--- a/ILSpy/Properties/Resources.Designer.cs
+++ b/ILSpy/Properties/Resources.Designer.cs
@@ -441,6 +441,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Cannot create PDB file for {0}, because it does not contain a PE Debug Directory Entry of type 'CodeView'..
+ ///
+ public static string CannotCreatePDBFile {
+ get {
+ return ResourceManager.GetString("CannotCreatePDBFile", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Check again.
///
@@ -558,6 +567,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to DEBUG -- Dump PDB as XML.
+ ///
+ public static string DEBUGDumpPDBAsXML {
+ get {
+ return ResourceManager.GetString("DEBUGDumpPDBAsXML", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Debug Steps.
///
@@ -576,6 +594,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Decompile.
+ ///
+ public static string Decompile {
+ get {
+ return ResourceManager.GetString("Decompile", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Decompiler.
///
@@ -585,6 +612,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Always inline local variables if possible.
+ ///
+ public static string DecompilerSettings_AggressiveInlining {
+ get {
+ return ResourceManager.GetString("DecompilerSettings.AggressiveInlining", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Allow extension 'Add' methods in collection initializer expressions.
///
@@ -829,7 +865,7 @@ namespace ICSharpCode.ILSpy.Properties {
}
///
- /// Looks up a localized string similar to Transform to do-while, if possible..
+ /// Looks up a localized string similar to Transform to do-while, if possible.
///
public static string DecompilerSettings_DoWhileStatement {
get {
@@ -838,7 +874,7 @@ namespace ICSharpCode.ILSpy.Properties {
}
///
- /// Looks up a localized string similar to Transform to for, if possible..
+ /// Looks up a localized string similar to Transform to for, if possible.
///
public static string DecompilerSettings_ForStatement {
get {
@@ -864,6 +900,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Allow init; accessors.
+ ///
+ public static string DecompilerSettings_InitAccessors {
+ get {
+ return ResourceManager.GetString("DecompilerSettings.InitAccessors", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Insert using declarations.
///
@@ -1002,7 +1047,7 @@ namespace ICSharpCode.ILSpy.Properties {
}
///
- /// Looks up a localized string similar to Separate local variable declarations and initializers (int x = 5; -> int x; x = 5;), if possible..
+ /// Looks up a localized string similar to Separate local variable declarations and initializers (int x = 5; -> int x; x = 5;), if possible.
///
public static string DecompilerSettings_SeparateLocalVariableDeclarations {
get {
@@ -1019,6 +1064,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Switch expressions.
+ ///
+ public static string DecompilerSettings_SwitchExpressions {
+ get {
+ return ResourceManager.GetString("DecompilerSettings.SwitchExpressions", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Use discards.
///
@@ -1379,6 +1433,33 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Generation complete in {0} seconds..
+ ///
+ public static string GenerationCompleteInSeconds {
+ get {
+ return ResourceManager.GetString("GenerationCompleteInSeconds", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Generation was cancelled..
+ ///
+ public static string GenerationWasCancelled {
+ get {
+ return ResourceManager.GetString("GenerationWasCancelled", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Go to token.
+ ///
+ public static string GoToToken {
+ get {
+ return ResourceManager.GetString("GoToToken", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Hide empty metadata tables from tree view.
///
@@ -1397,6 +1478,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to ILSpyAboutPage.txt.
+ ///
+ public static string ILSpyAboutPageTxt {
+ get {
+ return ResourceManager.GetString("ILSpyAboutPageTxt", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to ILSpy version .
///
@@ -1677,6 +1767,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Portable PDB|*.pdb|All files|*.*.
+ ///
+ public static string PortablePDBPdbAllFiles {
+ get {
+ return ResourceManager.GetString("PortablePDBPdbAllFiles", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies..
///
@@ -1931,6 +2030,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Select PDB....
+ ///
+ public static string SelectPDB {
+ get {
+ return ResourceManager.GetString("SelectPDB", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Select version of language to output.
///
@@ -2291,6 +2399,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
+ ///
+ /// Looks up a localized string similar to Visual Studio Solution file|*.sln|All files|*.*.
+ ///
+ public static string VisualStudioSolutionFileSlnAllFiles {
+ get {
+ return ResourceManager.GetString("VisualStudioSolutionFileSlnAllFiles", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Warning: This assembly is marked as 'reference assembly', which means that it only contains metadata and no executable code..
///
@@ -2319,7 +2436,7 @@ namespace ICSharpCode.ILSpy.Properties {
}
///
- /// Looks up a localized string similar to Close all documents.
+ /// Looks up a localized string similar to _Close all documents.
///
public static string Window_CloseAllDocuments {
get {
@@ -2328,7 +2445,7 @@ namespace ICSharpCode.ILSpy.Properties {
}
///
- /// Looks up a localized string similar to Reset layout.
+ /// Looks up a localized string similar to _Reset layout.
///
public static string Window_ResetLayout {
get {
diff --git a/ILSpy/Properties/Resources.resx b/ILSpy/Properties/Resources.resx
index 62a8ffa83..f5cb6e288 100644
--- a/ILSpy/Properties/Resources.resx
+++ b/ILSpy/Properties/Resources.resx
@@ -117,766 +117,805 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Navigation
+
+ About
-
- Back
+
+ Add preconfigured list...
-
- Forward
+
+ Add shell integration
-
- _Check for Updates
+
+ This will add "{0}" to the registry at "HKCU\Software\Classes\dllfile\shell\Open with ILSpy\command" and "HKCU\Software\Classes\exefile\shell\Open with ILSpy\command" to allow opening .dll and .exe files from the Windows Explorer context menu.
+
+Do you want to continue?
-
- _Help
+
+ |All Files|*.*
-
- _File
+
+ Allow multiple instances
-
- Open
+
+ Always use braces
-
- DEBUG -- Disassemble All
+
+ Analyze
-
- E_xit
+
+ Assemblies
-
- Exit
+
+ Assembly
-
- Save
+
+ The directory is not empty. File will be overwritten.
+Are you sure you want to continue?
-
- _Open...
+
+ Project Directory not empty
-
- Open from _GAC...
+
+ Automatically check for updates every week
-
- Manage assembly _lists...
+
+ Back
-
- Reload all assemblies
+
+ Base Types
-
- DEBUG -- Decompile All
+
+ C_lone
-
- DEBUG -- Decompile 100x
+
+ Cancel
-
- Generate portable PDB
+
+ Entity could not be resolved. Cannot analyze entities from missing assembly references. Add the missing reference and try again.
-
- Reload all assemblies
+
+ Cannot create PDB file for {0}, because it does not contain a PE Debug Directory Entry of type 'CodeView'.
-
- _Reload
+
+ Check again
-
- _Remove Assemblies with load errors
+
+ Check for updates
-
- Remove
+
+ Checking...
-
- _Save Code...
+
+ Close
-
- _Show debug steps
+
+ Collapse all tree nodes
-
- _View
+
+ Copy
-
- Sort assembly _list by name
+
+ Copy error message
-
- View
+
+ Copy FQ Name
-
- Sort assembly list by name
+
+ Create
-
- _Collapse all tree nodes
+
+ Culture
-
- Collapse all tree nodes
+
+ DEBUG -- Decompile All
-
- Name
+
+ DEBUG -- Decompile 100x
-
- Value (as string)
+
+ DEBUG -- Disassemble All
-
- Type
+
+ DEBUG -- Dump PDB as XML
-
- String Table
+
+ Debug Steps
-
- Value
+
+ Debug this step
-
- Use variable names from debug symbols, if available
+
+ Decompile
-
- Show info from debug symbols, if available
+
+ Decompile to new tab
-
- Show XML documentation in decompiled code
+
+ Decompiler
-
- Enable folding on all blocks in braces
+
+ Always inline local variables if possible
-
- Remove dead and side effect free code
+
+ Allow extension 'Add' methods in collection initializer expressions
-
- Insert using declarations
+
+ Use 'ref' extension methods
-
- Always use braces
+
+ Always cast targets of explicit interface implementation calls
-
- Expand member definitions after decompilation
+
+ Always show enum member values
-
- Font
+
+ Always use braces
-
- Other options
+
+ Apply Windows Runtime projections on loaded assemblies
-
- Show line numbers
+
+ Array initializer expressions
-
- Show metadata tokens
+
+ Decompile async IAsyncEnumerator methods
-
- Enable word wrap
+
+ Decompile ?. and ?[] operators
-
- Sort results by fitness
+
+ Decompile anonymous methods/lambdas
-
- Allow multiple instances
+
+ Decompile anonymous types
-
- Cancel
+
+ Decompile async methods
-
- OK
+
+ Decompile automatic events
-
- Search
+
+ Decompile automatic properties
-
- Search for t:TypeName, m:Member or c:Constant; use exact match (=term), 'should not contain' (-term) or 'must contain' (+term); use /reg(ular)?Ex(pressions)?/ or both - t:/Type(Name)?/...
+
+ Decompile await in catch/finally blocks
-
- _Search for:
+
+ Decompile C# 1.0 'public unsafe fixed int arr[10];' members
-
- Location
+
+ Decompile [DecimalConstant(...)] as simple literal values
-
- Decompiling...
+
+ Decompile enumerators (yield return)
-
- Copy
+
+ Decompile expression trees
-
- Editor
+
+ Decompile use of the 'dynamic' type
-
- Toggle All Folding
+
+ Detect awaited using and foreach statements
-
- Folding
+
+ Detect foreach statements
-
- Resources file (*.resources)|*.resources|Resource XML file|*.resx
+
+ Detect lock statements
-
- _Remove
+
+ Detect switch on string
-
- _Load Dependencies
+
+ Detect tuple comparisons
-
- Dependencies
+
+ Detect using statements
-
- _Add To Main List
+
+ Dictionary initializer expressions
-
- _Open Containing Folder
+
+ Transform to do-while, if possible
-
- Shell
+
+ F#-specific options
-
- _Open Command Line Here
+
+ Transform to for, if possible
-
- Copy FQ Name
+
+ Include XML documentation comments in the decompiled code
-
- Loading...
+
+ Allow init; accessors
-
- Copy error message
+
+ Insert using declarations
-
- Derived Types
+
+ Introduce local functions
-
- References
+
+ Introduce static local functions
-
- Resources
+
+ IsByRefLikeAttribute should be replaced with 'ref' modifiers on structs
-
- _About
+
+ IsReadOnlyAttribute should be replaced with 'readonly'/'in' modifiers on structs/parameters
-
- ILSpy version
+
+ IsUnmanagedAttribute on type parameters should be replaced with 'unmanaged' constraints
-
- Automatically check for updates every week
+
+ Use nint/nuint types
-
- Check for updates
+
+ Nullable reference types
-
- Checking...
+
+ Object/collection initializer expressions
-
- You are using the latest release.
+
+ Other
-
- Version {0} is available.
+
+ Ranges
-
- Download
+
+ Read-only methods
-
- You are using a nightly build newer than the latest release.
+
+ Remove dead and side effect free code (use with caution!)
-
- Show public, private and internal
+
+ Remove dead stores (use with caution!)
-
- Show public, private and internal
+
+ Remove optional arguments, if possible
-
- Stand by...
+
+ Separate local variable declarations and initializers (int x = 5; -> int x; x = 5;), if possible
-
- Status
+
+ Show info from debug symbols, if available
-
- A new ILSpy version is available.
+
+ Switch expressions
-
- No update for ILSpy found.
+
+ Use discards
-
- Check again
+
+ Use expression-bodied member syntax for get-only properties
-
- Searching...
+
+ Use extension method syntax
-
- Search aborted, more than 1000 results found.
+
+ Use implicit conversions between tuple types
-
- Search...
+
+ Use implicit method group conversions
-
- Display Code
+
+ Use LINQ expression syntax
-
- Save Code
+
+ Use lambda syntax, if possible
-
- |All Files|*.*
+
+ Use lifted operators for nullables
-
- Open Explorer
+
+ Use named arguments
-
- Select All
+
+ Use non-trailing named arguments
-
- Toggle Folding
+
+ Use out variable declarations
-
- Analyze
+
+ Use pattern-based fixed statement
-
- Enter a list name:
+
+ Use new SDK style format for generated project files (*.csproj)
-
- Create
+
+ Use stackalloc initializer syntax
-
- New list
+
+ Use string interpolation
-
- Select assemblies to open:
+
+ Use throw expressions
-
- Nuget Package Browser
+
+ Use tuple type syntax
-
- Open From GAC
+
+ Use variable names from debug symbols, if available
-
- _Search:
+
+ VB-specific options
-
- Reference Name
+
+ The settings selected below are applied to the decompiler output in combination with the selection in the language drop-down. Selecting a lower language version in the drop-down will deactivate all selected options of the higher versions. Note that some settings implicitly depend on each other, e.g.: LINQ expressions cannot be introduced without first transforming static calls to extension method calls.
-
- Version
+
+ Decompiling...
-
- Public Key Token
+
+ Dependencies
-
- Manage Assembly Lists
+
+ Derived Types
-
- Select a list:
+
+ Display
-
- _New
+
+ Display Code
-
- _Open
+
+ Font:
-
- _Delete
+
+ Download
-
- _Reset
+
+ E_xit
-
- Options
+
+ Editor
-
- _Options...
+
+ Enable folding on all blocks in braces
-
- Display
+
+ Enable word wrap
-
- Decompiler
+
+ Enter a list name:
-
- Misc
+
+ Exit
-
- Font:
+
+ Expand member definitions after decompilation
-
- Size:
+
+ Expand using declarations after decompilation
-
- Debug Steps
+
+ Folding
-
- UseFieldSugar
+
+ Font
-
- UseLogicOperationSugar
+
+ Forward
-
- ShowILRanges
+
+ Generate portable PDB
-
- ShowChildIndexInBlock
+
+ Generation complete in {0} seconds.
-
- Show state before this step
+
+ Generation was cancelled.
-
- Show state after this step
+
+ Go to token
-
- Debug this step
+
+ Hide empty metadata tables from tree view
-
- Warning: This assembly is marked as 'reference assembly', which means that it only contains metadata and no executable code.
+
+ Highlight matching braces
-
- Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts,
+
+ ILSpyAboutPage.txt
-
- for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies.
+
+ ILSpy version
-
- Show assembly load log
+
+ A new ILSpy version is available.
-
- Other Resources
+
+ Indent size:
-
- Use tabs instead of spaces
+
+ Indentation
-
- Show metadata tokens in base 10
+
+ Insert using declarations
-
- Expand using declarations after decompilation
+
+ Are you sure that you want to delete the selected assembly list?
+
+
+ A list with the same name was found.
+
+
+ Are you sure that you want to remove all assembly lists and recreate the default assembly lists?
Load assemblies that were loaded in the last instance.
-
- Indentation
+
+ Loading...
-
- Indent size:
+
+ Location
-
- Tab size:
+
+ Manage Assembly Lists
-
- Search (Ctrl+Shift+F or Ctrl+E)
+
+ Manage assembly _lists...
-
- Show all types and members
+
+ Misc
-
- Other
+
+ Name
-
- Show _all types and members
+
+ Navigation
-
- The settings selected below are applied to the decompiler output in combination with the selection in the language drop-down. Selecting a lower language version in the drop-down will deactivate all selected options of the higher versions. Note that some settings implicitly depend on each other, e.g.: LINQ expressions cannot be introduced without first transforming static calls to extension method calls.
+
+ Navigation failed because the target is hidden or a compiler-generated class.\n
+Please disable all filters that might hide the item (i.e. activate "View > Show internal types and members") and try again.
-
- Decompile enumerators (yield return)
+
+ New list
-
- Decompile anonymous methods/lambdas
+
+ New Tab
-
- Decompile anonymous types
+
+ Nuget Package Browser
-
- Use lambda syntax, if possible
+
+ OK
-
- Decompile expression trees
+
+ Open
-
- Decompile use of the 'dynamic' type
+
+ Open Explorer
-
- Decompile async methods
+
+ Open From GAC
-
- Decompile await in catch/finally blocks
+
+ Open from _GAC...
-
- Decompile [DecimalConstant(...)] as simple literal values
+
+ _Delete
-
- Decompile C# 1.0 'public unsafe fixed int arr[10];' members
+
+ _Open
-
- Use lifted operators for nullables
+
+ Options
-
- Decompile ?. and ?[] operators
+
+ Other
-
- Decompile automatic properties
+
+ Other options
-
- Decompile automatic events
+
+ Other Resources
-
- Detect using statements
+
+ Portable PDB|*.pdb|All files|*.*
-
- Other
+
+ for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies.
-
- Always use braces
+
+ Public Key Token
-
- Detect foreach statements
+
+ R_ename
-
- Detect lock statements
+
+ Reference Name
-
- Detect switch on string
+
+ References
-
- Insert using declarations
+
+ Reload all assemblies
-
- Use extension method syntax
+
+ Reload all assemblies
-
- Use LINQ expression syntax
+
+ Remove
-
- Use implicit method group conversions
+
+ Remove dead and side effect free code
-
- Always cast targets of explicit interface implementation calls
+
+ Remove shell integration
-
- Use variable names from debug symbols, if available
+
+ This will remove "{0}" from the registry at "HKCU\Software\Classes\dllfile\shell\Open with ILSpy\command" and "HKCU\Software\Classes\exefile\shell\Open with ILSpy\command".
+
+Do you want to continue?
-
- Array initializer expressions
+
+ Rename list
-
- Object/collection initializer expressions
+
+ Reset to defaults
-
- Dictionary initializer expressions
+
+ Do you really want to load the default settings for the active page?
-
- Allow extension 'Add' methods in collection initializer expressions
+
+ Resources file (*.resources)|*.resources|Resource XML file|*.resx
-
- Use string interpolation
+
+ Save
-
- Include XML documentation comments in the decompiled code
+
+ Save Code
-
- Use expression-bodied member syntax for get-only properties
+
+ Search...
-
- Use out variable declarations
+
+ Search aborted, more than 1000 results found.
-
- Use discards
+
+ Search (Ctrl+Shift+F or Ctrl+E)
-
- IsByRefLikeAttribute should be replaced with 'ref' modifiers on structs
+
+ Search Microsoft Docs...
-
- IsReadOnlyAttribute should be replaced with 'readonly'/'in' modifiers on structs/parameters
+
+ Search
-
- IsUnmanagedAttribute on type parameters should be replaced with 'unmanaged' constraints
+
+ Searching...
-
- Use stackalloc initializer syntax
+
+ Select All
-
- Use tuple type syntax
+
+ Select assemblies to open:
-
- Use implicit conversions between tuple types
+
+ Select a list of assemblies
-
- Detect tuple comparisons
+
+ Select language to decompile to
-
- Use named arguments
+
+ Select a list:
-
- Use non-trailing named arguments
+
+ Select PDB...
-
- Remove optional arguments, if possible
+
+ Select version of language to output
-
- Introduce local functions
+
+ Shell
-
- Nullable reference types
+
+ Show all types and members
-
+
+ Show assembly load log
+
+
+ ShowChildIndexInBlock
+
+
+ Show XML documentation in decompiled code
+
+
+ ShowILRanges
+
+
Show info from debug symbols, if available
-
- VB-specific options
+
+ Show public, private and internal
-
- F#-specific options
+
+ Show line numbers
-
- Remove dead and side effect free code (use with caution!)
+
+ Show metadata tokens
-
- Apply Windows Runtime projections on loaded assemblies
+
+ Show metadata tokens in base 10
-
- Search Microsoft Docs...
+
+ Show only public types and members
-
- Entity could not be resolved. Cannot analyze entities from missing assembly references. Add the missing reference and try again.
+
+ Show state after this step
-
- Use throw expressions
+
+ Show state before this step
-
- Use 'ref' extension methods
+
+ Show _all types and members
-
- The directory is not empty. File will be overwritten.
-Are you sure you want to continue?
+
+ Show public, private and internal
-
- Project Directory not empty
+
+ Show only _public types and members
-
- Highlight matching braces
+
+ Size:
-
- Select language to decompile to
+
+ Sort assembly list by name
-
- Select version of language to output
+
+ Sort assembly _list by name
-
- Remove dead stores (use with caution!)
+
+ Sort results by fitness
-
- Always show enum member values
+
+ Stand by...
-
- Show only public types and members
+
+ Status
-
- Show only _public types and members
+
+ String Table
-
- Assembly
+
+ Tab size:
-
- Decompile to new tab
+
+ Toggle All Folding
-
- Decompile async IAsyncEnumerator methods
+
+ Type
-
- Read-only methods
+
+ No update for ILSpy found.
-
- Detect awaited using and foreach statements
+
+ UseFieldSugar
-
- About
+
+ UseLogicOperationSugar
-
- Assemblies
+
+ Use tabs instead of spaces
-
- Close all documents
+
+ You are using the latest release.
-
- Reset layout
+
+ You are using a nightly build newer than the latest release.
-
- _Window
+
+ Value
-
- Use pattern-based fixed statement
+
+ Value (as string)
-
- Transform to do-while, if possible.
+
+ Use variable names from debug symbols, if available
-
- Transform to for, if possible.
+
+ Version
-
- Separate local variable declarations and initializers (int x = 5; -> int x; x = 5;), if possible.
+
+ Version {0} is available.
-
- Reset to defaults
+
+ View
-
- Do you really want to load the default settings for the active page?
+
+ Visual Studio Solution file|*.sln|All files|*.*
-
- Select a list of assemblies
+
+ Warning: This assembly is marked as 'reference assembly', which means that it only contains metadata and no executable code.
-
- Close
+
+ Warning: Some assembly references could not be resolved automatically. This might lead to incorrect decompilation of some parts,
-
- C_lone
+
+ Search for t:TypeName, m:Member or c:Constant; use exact match (=term), 'should not contain' (-term) or 'must contain' (+term); use /reg(ular)?Ex(pressions)?/ or both - t:/Type(Name)?/...
-
- Are you sure that you want to delete the selected assembly list?
+
+ _Close all documents
-
- A list with the same name was found.
+
+ _Reset layout
-
- Are you sure that you want to remove all assembly lists and recreate the default assembly lists?
+
+ _About
-
- Introduce static local functions
+
+ _Add To Main List
-
- Hide empty metadata tables from tree view
+
+ _Check for Updates
-
- Navigation failed because the target is hidden or a compiler-generated class.\n
-Please disable all filters that might hide the item (i.e. activate "View > Show internal types and members") and try again.
+
+ _Collapse all tree nodes
-
- Add shell integration
+
+ _File
-
- This will add "{0}" to the registry at "HKCU\Software\Classes\dllfile\shell\Open with ILSpy\command" and "HKCU\Software\Classes\exefile\shell\Open with ILSpy\command" to allow opening .dll and .exe files from the Windows Explorer context menu.
-
-Do you want to continue?
+
+ _Help
-
- Remove shell integration
+
+ _Load Dependencies
-
- This will remove "{0}" from the registry at "HKCU\Software\Classes\dllfile\shell\Open with ILSpy\command" and "HKCU\Software\Classes\exefile\shell\Open with ILSpy\command".
-
-Do you want to continue?
+
+ _New
-
- Ranges
+
+