Browse Source

Fix #133: When opening a module from the command line, navigate to that module automatically.

pull/312/merge
Daniel Grunwald 14 years ago
parent
commit
4c9e0bd07c
  1. 3
      ILSpy/ILSpy.csproj
  2. 28
      ILSpy/MainWindow.xaml.cs

3
ILSpy/ILSpy.csproj

@ -17,7 +17,7 @@
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<ApplicationIcon>Images\ILSpy.ico</ApplicationIcon> <ApplicationIcon>Images\ILSpy.ico</ApplicationIcon>
<RunCodeAnalysis>False</RunCodeAnalysis> <RunCodeAnalysis>False</RunCodeAnalysis>
<StartArguments>/separate</StartArguments> <StartArguments>/separate "C:\temp\decompiled\Mono.Cecil.dll"</StartArguments>
<SignAssembly>True</SignAssembly> <SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\NRefactory\ICSharpCode.NRefactory.snk</AssemblyOriginatorKeyFile> <AssemblyOriginatorKeyFile>..\NRefactory\ICSharpCode.NRefactory.snk</AssemblyOriginatorKeyFile>
<DelaySign>False</DelaySign> <DelaySign>False</DelaySign>
@ -28,6 +28,7 @@
<RegisterForComInterop>False</RegisterForComInterop> <RegisterForComInterop>False</RegisterForComInterop>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<BaseAddress>4194304</BaseAddress> <BaseAddress>4194304</BaseAddress>
<FileAlignment>4096</FileAlignment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' "> <PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>

28
ILSpy/MainWindow.xaml.cs

@ -270,9 +270,23 @@ namespace ICSharpCode.ILSpy
} }
if (!found) { if (!found) {
AvalonEditTextOutput output = new AvalonEditTextOutput(); AvalonEditTextOutput output = new AvalonEditTextOutput();
output.Write("Cannot find " + args.NavigateTo); output.Write(string.Format("Cannot find '{0}' in command line specified assemblies.", args.NavigateTo));
decompilerTextView.ShowText(output); decompilerTextView.ShowText(output);
} }
} else if (commandLineLoadedAssemblies.Count == 1) {
// NavigateTo == null and an assembly was given on the command-line:
// Select the newly loaded assembly
JumpToReference(commandLineLoadedAssemblies[0].AssemblyDefinition);
} else {
SharpTreeNode node = FindNodeByPath(sessionSettings.ActiveTreeViewPath, true);
if (node != null) {
SelectNode(node);
// only if not showing the about page, perform the update check:
ShowMessageIfUpdatesAvailableAsync(spySettings);
} else {
AboutPage.Display(decompilerTextView);
}
} }
commandLineLoadedAssemblies.Clear(); // clear references once we don't need them anymore commandLineLoadedAssemblies.Clear(); // clear references once we don't need them anymore
} }
@ -297,18 +311,6 @@ namespace ICSharpCode.ILSpy
ShowAssemblyList(this.assemblyList); ShowAssemblyList(this.assemblyList);
HandleCommandLineArgumentsAfterShowList(App.CommandLineArguments); HandleCommandLineArgumentsAfterShowList(App.CommandLineArguments);
if (App.CommandLineArguments.NavigateTo == null) {
SharpTreeNode node = FindNodeByPath(sessionSettings.ActiveTreeViewPath, true);
if (node != null) {
SelectNode(node);
// only if not showing the about page, perform the update check:
ShowMessageIfUpdatesAvailableAsync(spySettings);
} else {
AboutPage.Display(decompilerTextView);
}
}
} }
#region Update Check #region Update Check

Loading…
Cancel
Save