Browse Source

Add something missing.

pull/2066/head
MysticBoy 5 years ago
parent
commit
865f855501
  1. 5
      ILSpy/Commands/DecompileCommand.cs
  2. 10
      ILSpy/Commands/GeneratePdbContextMenuEntry.cs
  3. 2
      ILSpy/Commands/SaveCodeContextMenuEntry.cs
  4. 5
      ILSpy/Commands/SelectPdbContextMenuEntry.cs
  5. 64
      ILSpy/Properties/Resources.Designer.cs
  6. 18
      ILSpy/Properties/Resources.resx
  7. 18
      ILSpy/Properties/Resources.zh-Hans.resx

5
ILSpy/Commands/DecompileCommand.cs

@ -24,11 +24,12 @@ using System.Windows.Controls; @@ -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 @@ -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)

10
ILSpy/Commands/GeneratePdbContextMenuEntry.cs

@ -32,7 +32,7 @@ using ICSharpCode.ILSpy.Properties; @@ -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 @@ -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();
@ -81,14 +81,14 @@ namespace ICSharpCode.ILSpy @@ -81,14 +81,14 @@ namespace ICSharpCode.ILSpy
stopwatch.Stop();
output.WriteLine("Generation complete in " + stopwatch.Elapsed.TotalSeconds.ToString("F1") + " seconds.");
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 = Resources.Save)]
class GeneratePdbMainMenuEntry : SimpleCommand
{
public override bool CanExecute(object parameter)

2
ILSpy/Commands/SaveCodeContextMenuEntry.cs

@ -93,7 +93,7 @@ namespace ICSharpCode.ILSpy.TextView @@ -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;

5
ILSpy/Commands/SelectPdbContextMenuEntry.cs

@ -18,12 +18,13 @@ @@ -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 @@ -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;

64
ILSpy/Properties/Resources.Designer.cs generated

@ -441,6 +441,15 @@ namespace ICSharpCode.ILSpy.Properties { @@ -441,6 +441,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
/// <summary>
/// 查找类似 Cannot create PDB file for {0}, because it does not contain a PE Debug Directory Entry of type &apos;CodeView&apos;. 的本地化字符串。
/// </summary>
public static string CannotCreatePDBFile {
get {
return ResourceManager.GetString("CannotCreatePDBFile", resourceCulture);
}
}
/// <summary>
/// 查找类似 Check again 的本地化字符串。
/// </summary>
@ -585,6 +594,15 @@ namespace ICSharpCode.ILSpy.Properties { @@ -585,6 +594,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
/// <summary>
/// 查找类似 Decompile 的本地化字符串。
/// </summary>
public static string Decompile {
get {
return ResourceManager.GetString("Decompile", resourceCulture);
}
}
/// <summary>
/// 查找类似 Decompiler 的本地化字符串。
/// </summary>
@ -838,7 +856,7 @@ namespace ICSharpCode.ILSpy.Properties { @@ -838,7 +856,7 @@ namespace ICSharpCode.ILSpy.Properties {
}
/// <summary>
/// 查找类似 Transform to do-while, if possible. 的本地化字符串。
/// 查找类似 Transform to do-while, if possible 的本地化字符串。
/// </summary>
public static string DecompilerSettings_DoWhileStatement {
get {
@ -847,7 +865,7 @@ namespace ICSharpCode.ILSpy.Properties { @@ -847,7 +865,7 @@ namespace ICSharpCode.ILSpy.Properties {
}
/// <summary>
/// 查找类似 Transform to for, if possible. 的本地化字符串。
/// 查找类似 Transform to for, if possible 的本地化字符串。
/// </summary>
public static string DecompilerSettings_ForStatement {
get {
@ -1011,7 +1029,7 @@ namespace ICSharpCode.ILSpy.Properties { @@ -1011,7 +1029,7 @@ namespace ICSharpCode.ILSpy.Properties {
}
/// <summary>
/// 查找类似 Separate local variable declarations and initializers (int x = 5; -&gt; int x; x = 5;), if possible. 的本地化字符串。
/// 查找类似 Separate local variable declarations and initializers (int x = 5; -&gt; int x; x = 5;), if possible 的本地化字符串。
/// </summary>
public static string DecompilerSettings_SeparateLocalVariableDeclarations {
get {
@ -1388,6 +1406,15 @@ namespace ICSharpCode.ILSpy.Properties { @@ -1388,6 +1406,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
/// <summary>
/// 查找类似 Go to token 的本地化字符串。
/// </summary>
public static string GoToToken {
get {
return ResourceManager.GetString("GoToToken", resourceCulture);
}
}
/// <summary>
/// 查找类似 Hide empty metadata tables from tree view 的本地化字符串。
/// </summary>
@ -1695,6 +1722,15 @@ namespace ICSharpCode.ILSpy.Properties { @@ -1695,6 +1722,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
/// <summary>
/// 查找类似 Portable PDB|*.pdb|All files|*.* 的本地化字符串。
/// </summary>
public static string PortablePDBPdbAllFiles {
get {
return ResourceManager.GetString("PortablePDBPdbAllFiles", resourceCulture);
}
}
/// <summary>
/// 查找类似 for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies. 的本地化字符串。
/// </summary>
@ -1949,6 +1985,15 @@ namespace ICSharpCode.ILSpy.Properties { @@ -1949,6 +1985,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
/// <summary>
/// 查找类似 Select PDB... 的本地化字符串。
/// </summary>
public static string SelectPDB {
get {
return ResourceManager.GetString("SelectPDB", resourceCulture);
}
}
/// <summary>
/// 查找类似 Select version of language to output 的本地化字符串。
/// </summary>
@ -2309,6 +2354,15 @@ namespace ICSharpCode.ILSpy.Properties { @@ -2309,6 +2354,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
/// <summary>
/// 查找类似 Visual Studio Solution file|*.sln|All files|*.* 的本地化字符串。
/// </summary>
public static string VisualStudioSolutionFileSlnAllFiles {
get {
return ResourceManager.GetString("VisualStudioSolutionFileSlnAllFiles", resourceCulture);
}
}
/// <summary>
/// 查找类似 Warning: This assembly is marked as &apos;reference assembly&apos;, which means that it only contains metadata and no executable code. 的本地化字符串。
/// </summary>
@ -2337,7 +2391,7 @@ namespace ICSharpCode.ILSpy.Properties { @@ -2337,7 +2391,7 @@ namespace ICSharpCode.ILSpy.Properties {
}
/// <summary>
/// 查找类似 Close all documents 的本地化字符串。
/// 查找类似 _Close all documents 的本地化字符串。
/// </summary>
public static string Window_CloseAllDocuments {
get {
@ -2346,7 +2400,7 @@ namespace ICSharpCode.ILSpy.Properties { @@ -2346,7 +2400,7 @@ namespace ICSharpCode.ILSpy.Properties {
}
/// <summary>
/// 查找类似 Reset layout 的本地化字符串。
/// 查找类似 _Reset layout 的本地化字符串。
/// </summary>
public static string Window_ResetLayout {
get {

18
ILSpy/Properties/Resources.resx

@ -885,4 +885,22 @@ Do you want to continue?</value> @@ -885,4 +885,22 @@ Do you want to continue?</value>
<data name="ILSpyAboutPageTxt" xml:space="preserve">
<value>ILSpyAboutPage.txt</value>
</data>
<data name="SelectPDB" xml:space="preserve">
<value>Select PDB...</value>
</data>
<data name="PortablePDBPdbAllFiles" xml:space="preserve">
<value>Portable PDB|*.pdb|All files|*.*</value>
</data>
<data name="Decompile" xml:space="preserve">
<value>Decompile</value>
</data>
<data name="GoToToken" xml:space="preserve">
<value>Go to token</value>
</data>
<data name="CannotCreatePDBFile" xml:space="preserve">
<value>Cannot create PDB file for {0}, because it does not contain a PE Debug Directory Entry of type 'CodeView'.</value>
</data>
<data name="VisualStudioSolutionFileSlnAllFiles" xml:space="preserve">
<value>Visual Studio Solution file|*.sln|All files|*.*</value>
</data>
</root>

18
ILSpy/Properties/Resources.zh-Hans.resx

@ -885,4 +885,22 @@ @@ -885,4 +885,22 @@
<data name="BaseTypes" xml:space="preserve">
<value>基类型</value>
</data>
<data name="CannotCreatePDBFile" xml:space="preserve">
<value>无法创建为{0}创建PDB文件,因为它不包含PE调试目录类型 'CodeView'.</value>
</data>
<data name="VisualStudioSolutionFileSlnAllFiles" xml:space="preserve">
<value>Visual Studio 解决方案文件(*.sln)|*.sln|所有文件(*.*)|*.*</value>
</data>
<data name="GoToToken" xml:space="preserve">
<value>转至令牌</value>
</data>
<data name="Decompile" xml:space="preserve">
<value>反编译</value>
</data>
<data name="PortablePDBPdbAllFiles" xml:space="preserve">
<value>可携带 PDB(*.pdb)|*.pdb|所有文件(*.*)|*.*</value>
</data>
<data name="SelectPDB" xml:space="preserve">
<value>选择 PDB...</value>
</data>
</root>
Loading…
Cancel
Save