Browse Source

Fix #582: Collapse All button for the assemblies list

pull/940/merge
Siegfried Pammer 8 years ago
parent
commit
4885299816
  1. 24
      ILSpy/Commands/SortAssemblyListCommand.cs
  2. 1
      ILSpy/ILSpy.csproj
  3. BIN
      ILSpy/Images/CollapseAll.png

24
ILSpy/Commands/SortAssemblyListCommand.cs

@ -18,12 +18,13 @@ @@ -18,12 +18,13 @@
using System;
using System.Collections.Generic;
using ICSharpCode.TreeView;
namespace ICSharpCode.ILSpy
{
[ExportMainMenuCommand(Menu = "_View", Header = "Sort assembly list by name", MenuIcon = "Images/Sort.png", MenuCategory = "View")]
[ExportToolbarCommand(ToolTip = "Sort assembly list by name", ToolbarIcon = "Images/Sort.png", ToolbarCategory = "View")]
class SortAssemblyListCommand : SimpleCommand, IComparer<LoadedAssembly>
sealed class SortAssemblyListCommand : SimpleCommand, IComparer<LoadedAssembly>
{
public override void Execute(object parameter)
{
@ -36,4 +37,25 @@ namespace ICSharpCode.ILSpy @@ -36,4 +37,25 @@ namespace ICSharpCode.ILSpy
return string.Compare(x.ShortName, y.ShortName, StringComparison.CurrentCulture);
}
}
[ExportMainMenuCommand(Menu = "_View", Header = "Collapse all tree nodes", MenuIcon = "Images/CollapseAll.png", MenuCategory = "View")]
[ExportToolbarCommand(ToolTip = "Collapse all tree nodes", ToolbarIcon = "Images/CollapseAll.png", ToolbarCategory = "View")]
sealed class CollapseAllCommand : SimpleCommand
{
public override void Execute(object parameter)
{
using (MainWindow.Instance.treeView.LockUpdates())
CollapseChildren(MainWindow.Instance.treeView.Root);
void CollapseChildren(SharpTreeNode node)
{
foreach (var child in node.Children) {
if (!child.IsExpanded)
continue;
CollapseChildren(child);
child.IsExpanded = false;
}
}
}
}
}

1
ILSpy/ILSpy.csproj

@ -346,6 +346,7 @@ @@ -346,6 +346,7 @@
<Resource Include="Images\PrivateInternal.png" />
<Resource Include="Images\Refresh.png" />
<Resource Include="Images\Constructor.png" />
<Resource Include="Images\CollapseAll.png" />
<Resource Include="Images\EnumValue.png" />
<Resource Include="Images\FieldReadOnly.png" />
<Resource Include="Images\OverlayInternal.png" />

BIN
ILSpy/Images/CollapseAll.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

Loading…
Cancel
Save