Browse Source

Add ExpandAllCommand

pull/3519/head
Siegfried Pammer 6 months ago
parent
commit
e574bc24c0
  1. 10
      ILSpy/ViewModels/CompareViewModel.cs
  2. 5
      ILSpy/Views/CompareView.xaml

10
ILSpy/ViewModels/CompareViewModel.cs

@ -68,6 +68,7 @@ namespace ICSharpCode.ILSpy.ViewModels @@ -68,6 +68,7 @@ namespace ICSharpCode.ILSpy.ViewModels
this.root = new ComparisonEntryTreeNode(MergeTrees(leftTree.Item2, rightTree.Item2), this);
this.SwapAssembliesCommand = new DelegateCommand(OnSwapAssemblies);
this.ExpandAllCommand = new DelegateCommand(OnExpandAll);
this.PropertyChanged += CompareViewModel_PropertyChanged;
}
@ -150,6 +151,7 @@ namespace ICSharpCode.ILSpy.ViewModels @@ -150,6 +151,7 @@ namespace ICSharpCode.ILSpy.ViewModels
}
public ICommand SwapAssembliesCommand { get; set; }
public ICommand ExpandAllCommand { get; set; }
void OnSwapAssemblies()
{
@ -160,6 +162,14 @@ namespace ICSharpCode.ILSpy.ViewModels @@ -160,6 +162,14 @@ namespace ICSharpCode.ILSpy.ViewModels
OnPropertyChanged(nameof(RightAssembly));
}
public void OnExpandAll()
{
foreach (var node in RootEntry.DescendantsAndSelf())
{
node.IsExpanded = true;
}
}
Entry MergeTrees(Entry a, Entry b)
{
var m = new Entry() {

5
ILSpy/Views/CompareView.xaml

@ -13,12 +13,9 @@ @@ -13,12 +13,9 @@
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ToolBar>
<Label Content="Left:" />
<TextBlock VerticalAlignment="Center" Text="{Binding LeftAssembly.Text}" />
<Label Content="Right:" />
<TextBlock VerticalAlignment="Center" Text="{Binding RightAssembly.Text}" />
<Button Content="Swap" Command="{Binding SwapAssembliesCommand}" />
<ToggleButton Content="Show identical" IsChecked="{Binding ShowIdentical}" />
<Button Content="Expand all" Command="{Binding ExpandAllCommand}" />
</ToolBar>
<stv:SharpTreeView Grid.Row="1" Root="{Binding RootEntry}" ShowRoot="True">
<stv:SharpTreeView.ItemContainerStyle>

Loading…
Cancel
Save