Browse Source

#2117: Print hints about project format after decompilation.

pull/2126/head
Siegfried Pammer 5 years ago
parent
commit
bfa4a27f39
  1. 2
      ILSpy/Commands/GeneratePdbContextMenuEntry.cs
  2. 36
      ILSpy/Properties/Resources.Designer.cs
  3. 12
      ILSpy/Properties/Resources.resx
  4. 16
      ILSpy/TextView/DecompilerTextView.cs

2
ILSpy/Commands/GeneratePdbContextMenuEntry.cs

@ -79,7 +79,7 @@ namespace ICSharpCode.ILSpy @@ -79,7 +79,7 @@ namespace ICSharpCode.ILSpy
}
}
stopwatch.Stop();
output.WriteLine(string.Format(Resources.GenerationCompleteInSeconds, stopwatch.Elapsed.TotalSeconds.ToString("F1")));
output.WriteLine(Resources.GenerationCompleteInSeconds, stopwatch.Elapsed.TotalSeconds.ToString("F1"));
output.WriteLine();
output.AddButton(null, Resources.OpenExplorer, delegate { Process.Start("explorer", "/select,\"" + fileName + "\""); });
output.WriteLine();

36
ILSpy/Properties/Resources.Designer.cs generated

@ -594,6 +594,15 @@ namespace ICSharpCode.ILSpy.Properties { @@ -594,6 +594,15 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Decompilation complete in {0:F1} seconds..
/// </summary>
public static string DecompilationCompleteInF1Seconds {
get {
return ResourceManager.GetString("DecompilationCompleteInF1Seconds", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Decompile.
/// </summary>
@ -1803,6 +1812,33 @@ namespace ICSharpCode.ILSpy.Properties { @@ -1803,6 +1812,33 @@ namespace ICSharpCode.ILSpy.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to You can change this by toggling the setting at Options &gt; Decompiler &gt; Other &gt; Use new SDK style format for generated project files (*.csproj)..
/// </summary>
public static string ProjectExportFormatChangeSettingHint {
get {
return ResourceManager.GetString("ProjectExportFormatChangeSettingHint", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to A Non-SDK project was generated. Learn more at https://docs.microsoft.com/en-us/nuget/resources/check-project-format..
/// </summary>
public static string ProjectExportFormatNonSDKHint {
get {
return ResourceManager.GetString("ProjectExportFormatNonSDKHint", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to A SDK-style project was generated. Learn more at https://docs.microsoft.com/en-us/nuget/resources/check-project-format..
/// </summary>
public static string ProjectExportFormatSDKHint {
get {
return ResourceManager.GetString("ProjectExportFormatSDKHint", resourceCulture);
}
}
/// <summary>
/// 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..
/// </summary>

12
ILSpy/Properties/Resources.resx

@ -225,6 +225,9 @@ Are you sure you want to continue?</value> @@ -225,6 +225,9 @@ Are you sure you want to continue?</value>
<data name="DebugThisStep" xml:space="preserve">
<value>Debug this step</value>
</data>
<data name="DecompilationCompleteInF1Seconds" xml:space="preserve">
<value>Decompilation complete in {0:F1} seconds.</value>
</data>
<data name="Decompile" xml:space="preserve">
<value>Decompile</value>
</data>
@ -628,6 +631,15 @@ Please disable all filters that might hide the item (i.e. activate "View &gt; Sh @@ -628,6 +631,15 @@ Please disable all filters that might hide the item (i.e. activate "View &gt; Sh
<data name="PortablePDBPdbAllFiles" xml:space="preserve">
<value>Portable PDB|*.pdb|All files|*.*</value>
</data>
<data name="ProjectExportFormatChangeSettingHint" xml:space="preserve">
<value>You can change this by toggling the setting at Options &gt; Decompiler &gt; Other &gt; Use new SDK style format for generated project files (*.csproj).</value>
</data>
<data name="ProjectExportFormatNonSDKHint" xml:space="preserve">
<value>A Non-SDK project was generated. Learn more at https://docs.microsoft.com/en-us/nuget/resources/check-project-format.</value>
</data>
<data name="ProjectExportFormatSDKHint" xml:space="preserve">
<value>A SDK-style project was generated. Learn more at https://docs.microsoft.com/en-us/nuget/resources/check-project-format.</value>
</data>
<data name="PropertyManuallyMissingReferencesListLoadedAssemblies" xml:space="preserve">
<value>for ex. property getter/setter access. To get optimal decompilation results, please manually add the missing references to the list of loaded assemblies.</value>
</data>

16
ILSpy/TextView/DecompilerTextView.cs

@ -965,8 +965,20 @@ namespace ICSharpCode.ILSpy.TextView @@ -965,8 +965,20 @@ namespace ICSharpCode.ILSpy.TextView
}
}
stopwatch.Stop();
AvalonEditTextOutput output = new AvalonEditTextOutput();
output.WriteLine("Decompilation complete in " + stopwatch.Elapsed.TotalSeconds.ToString("F1") + " seconds.");
AvalonEditTextOutput output = new AvalonEditTextOutput {
EnableHyperlinks = true,
Title = string.Join(", ", context.TreeNodes.Select(n => n.Text))
};
output.WriteLine(Properties.Resources.DecompilationCompleteInF1Seconds, stopwatch.Elapsed.TotalSeconds);
if (context.Options.SaveAsProjectDirectory != null) {
output.WriteLine();
if (context.Options.DecompilerSettings.UseSdkStyleProjectFormat)
output.WriteLine(Properties.Resources.ProjectExportFormatSDKHint);
else
output.WriteLine(Properties.Resources.ProjectExportFormatNonSDKHint);
output.WriteLine(Properties.Resources.ProjectExportFormatChangeSettingHint);
}
output.WriteLine();
output.AddButton(null, Properties.Resources.OpenExplorer, delegate { Process.Start("explorer", "/select,\"" + fileName + "\""); });
output.WriteLine();

Loading…
Cancel
Save