diff --git a/ILSpy/CommandLineArguments.cs b/ILSpy/CommandLineArguments.cs index 0c4aa3e4c..4ee5c1af2 100644 --- a/ILSpy/CommandLineArguments.cs +++ b/ILSpy/CommandLineArguments.cs @@ -30,8 +30,6 @@ namespace ICSharpCode.ILSpy public string Search; public string Language; public bool NoActivate; - public Guid? FixedGuid; - public string SaveDirectory; public CommandLineArguments(IEnumerable arguments) { @@ -51,15 +49,6 @@ namespace ICSharpCode.ILSpy this.Language = arg.Substring("/language:".Length); else if (arg.Equals("/noActivate", StringComparison.OrdinalIgnoreCase)) this.NoActivate = true; - else if (arg.StartsWith("/fixedGuid:", StringComparison.OrdinalIgnoreCase)) { - string guid = arg.Substring("/fixedGuid:".Length); - if (guid.Length < 32) - guid = guid + new string('0', 32 - guid.Length); - Guid fixedGuid; - if (Guid.TryParse(guid, out fixedGuid)) - this.FixedGuid = fixedGuid; - } else if (arg.StartsWith("/saveDir:", StringComparison.OrdinalIgnoreCase)) - this.SaveDirectory = arg.Substring("/saveDir:".Length); } else { this.AssembliesToLoad.Add(arg); } diff --git a/ILSpy/Languages/CSharpLanguage.cs b/ILSpy/Languages/CSharpLanguage.cs index 9b0379b36..0a71362d0 100644 --- a/ILSpy/Languages/CSharpLanguage.cs +++ b/ILSpy/Languages/CSharpLanguage.cs @@ -325,7 +325,6 @@ namespace ICSharpCode.ILSpy var module = assembly.GetModuleDefinitionAsync().Result; if (options.FullDecompilation && options.SaveAsProjectDirectory != null) { var decompiler = new ILSpyWholeProjectDecompiler(assembly, options); - decompiler.ProjectGuid = App.CommandLineArguments.FixedGuid; decompiler.DecompileProject(module, options.SaveAsProjectDirectory, new TextOutputWriter(output), options.CancellationToken); } else { AddReferenceWarningMessage(module.Assembly, output); diff --git a/ILSpy/MainWindow.xaml.cs b/ILSpy/MainWindow.xaml.cs index 11a79ef1a..419658af8 100644 --- a/ILSpy/MainWindow.xaml.cs +++ b/ILSpy/MainWindow.xaml.cs @@ -254,15 +254,9 @@ namespace ICSharpCode.ILSpy return true; } - async void HandleCommandLineArgumentsAfterShowList(CommandLineArguments args) + void HandleCommandLineArgumentsAfterShowList(CommandLineArguments args) { - // if a SaveDirectory is given, do not start a second concurrent decompilation - // by executing JumpoToReference (leads to https://github.com/icsharpcode/ILSpy/issues/710) - if (!string.IsNullOrEmpty(args.SaveDirectory)) { - var tasks = commandLineLoadedAssemblies.Select(a => a.GetModuleDefinitionAsync()).ToArray(); - var modules = await Task.WhenAll(tasks); - ExportAssemblies(modules, args.SaveDirectory); - } else if (args.NavigateTo != null) { + if (args.NavigateTo != null) { bool found = false; if (args.NavigateTo.StartsWith("N:", StringComparison.Ordinal)) { string namespaceName = args.NavigateTo.Substring(2); @@ -308,29 +302,6 @@ namespace ICSharpCode.ILSpy commandLineLoadedAssemblies.Clear(); // clear references once we don't need them anymore } - void ExportAssemblies(ModuleDefinition[] modules, string path) - { - Language language = sessionSettings.FilterSettings.Language; - TextView.SaveAssembliesToDisk(language, modules.Select(m => assemblyListTreeNode.FindAssemblyNode(m)).Where(m => m != null).ToArray(), path); - } - - void OnExportAssembly(Task moduleTask, string path) - { - AssemblyTreeNode asmNode = assemblyListTreeNode.FindAssemblyNode(moduleTask.Result); - if (asmNode != null) { - string file = DecompilerTextView.CleanUpName(asmNode.LoadedAssembly.ShortName); - Language language = sessionSettings.FilterSettings.Language; - DecompilationOptions options = new DecompilationOptions(); - options.FullDecompilation = true; - options.SaveAsProjectDirectory = Path.Combine(path, file); - if (!Directory.Exists(options.SaveAsProjectDirectory)) { - Directory.CreateDirectory(options.SaveAsProjectDirectory); - } - string fullFile = Path.Combine(options.SaveAsProjectDirectory, file + language.ProjectFileExtension); - TextView.SaveToDisk(language, new[] { asmNode }, options, fullFile); - } - } - void MainWindow_Loaded(object sender, RoutedEventArgs e) { ILSpySettings spySettings = this.spySettings; @@ -359,7 +330,7 @@ namespace ICSharpCode.ILSpy void OpenAssemblies(ILSpySettings spySettings) { HandleCommandLineArgumentsAfterShowList(App.CommandLineArguments); - if (string.IsNullOrEmpty(App.CommandLineArguments.SaveDirectory) && App.CommandLineArguments.NavigateTo == null && App.CommandLineArguments.AssembliesToLoad.Count != 1) { + if (App.CommandLineArguments.NavigateTo == null && App.CommandLineArguments.AssembliesToLoad.Count != 1) { SharpTreeNode node = null; if (sessionSettings.ActiveTreeViewPath != null) { node = FindNodeByPath(sessionSettings.ActiveTreeViewPath, true);