Browse Source

Add option to show/hide internal members.

pull/1/head
Daniel Grunwald 15 years ago
parent
commit
2bd56f05ea
  1. 6
      ILSpy/ILSpy.csproj
  2. 16
      ILSpy/ILSpyTreeNode.cs
  3. BIN
      ILSpy/Images/Back.png
  4. BIN
      ILSpy/Images/Forward.png
  5. BIN
      ILSpy/Images/PrivateInternal.png
  6. 53
      ILSpy/MainWindow.xaml
  7. 1
      ILSpy/MainWindow.xaml.cs
  8. 2
      ILSpy/NamespaceTreeNode.cs
  9. 2
      ILSpy/ResourceListTreeNode.cs

6
ILSpy/ILSpy.csproj

@ -199,5 +199,11 @@ @@ -199,5 +199,11 @@
<ItemGroup>
<Resource Include="Images\Resource.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\Back.png" />
<Resource Include="Images\Forward.png" />
<Resource Include="Images\PrivateInternal.png" />
<Resource Include="Images\Refresh.png" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
</Project>

16
ILSpy/ILSpyTreeNode.cs

@ -64,11 +64,15 @@ namespace ICSharpCode.ILSpy @@ -64,11 +64,15 @@ namespace ICSharpCode.ILSpy
/// </summary>
Hidden,
/// <summary>
/// Shows the node.
/// Shows the node (and resets the search term for child nodes).
/// </summary>
Match,
/// <summary>
/// Hides the node only if all children are hidden.
/// Hides the node only if all children are hidden (and resets the search term for child nodes).
/// </summary>
MatchAndRecurse,
/// <summary>
/// Hides the node only if all children are hidden (doesn't reset the search term for child nodes).
/// </summary>
Recurse
}
@ -127,8 +131,8 @@ namespace ICSharpCode.ILSpy @@ -127,8 +131,8 @@ namespace ICSharpCode.ILSpy
// don't add to base.Children
break;
case FilterResult.Match:
base.Children.Add(child);
child.FilterSettings = StripSearchTerm(this.FilterSettings);
base.Children.Add(child);
break;
case FilterResult.Recurse:
child.FilterSettings = this.FilterSettings;
@ -136,6 +140,12 @@ namespace ICSharpCode.ILSpy @@ -136,6 +140,12 @@ namespace ICSharpCode.ILSpy
if (child.VisibleChildren.Count > 0)
base.Children.Add(child);
break;
case FilterResult.MatchAndRecurse:
child.FilterSettings = StripSearchTerm(this.FilterSettings);
child.EnsureLazyChildren();
if (child.VisibleChildren.Count > 0)
base.Children.Add(child);
break;
default:
throw new InvalidEnumArgumentException();
}

BIN
ILSpy/Images/Back.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 923 B

BIN
ILSpy/Images/Forward.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 B

BIN
ILSpy/Images/PrivateInternal.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

53
ILSpy/MainWindow.xaml

@ -17,58 +17,53 @@ @@ -17,58 +17,53 @@
Executed="OpenCommandExecuted" />
</Window.CommandBindings>
<DockPanel>
<Menu
DockPanel.Dock="Top">
<MenuItem
Header="_File">
<MenuItem
Command="Open">
<!-- Main menu -->
<Menu DockPanel.Dock="Top">
<MenuItem Header="_File">
<MenuItem Command="Open">
<MenuItem.Icon>
<Image
Width="16"
Height="16"
Source="Images/Open.png" />
<Image Width="16" Height="16" Source="Images/Open.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Open from _GAC" Click="OpenFromGac_Click" />
<Separator />
<MenuItem
Header="E_xit"
Click="ExitClick" />
<MenuItem Header="E_xit" Click="ExitClick" />
</MenuItem>
<MenuItem Header="_View">
<MenuItem Header="Show _internal types and members" IsCheckable="True" IsChecked="{Binding ShowInternalApi}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="Images/PrivateInternal.png" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem
Header="_Help">
<MenuItem
Header="_About"
Click="AboutClick" />
<MenuItem Header="_Help">
<MenuItem Header="_About" Click="AboutClick" />
</MenuItem>
</Menu>
<!-- ToolBar -->
<ToolBar
Name="toolBar"
DockPanel.Dock="Top">
<ToolBar.Resources>
<!-- Make images transparent if menu command is disabled -->
<Style
TargetType="{x:Type Image}">
<Style TargetType="{x:Type Image}">
<Style.Triggers>
<DataTrigger
Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type ButtonBase}, AncestorLevel=1}, Path=IsEnabled}"
Value="False">
<Setter
Property="Opacity"
Value="0.30" />
<Setter Property="Opacity" Value="0.30" />
</DataTrigger>
</Style.Triggers>
</Style>
</ToolBar.Resources>
<Button
Command="Open">
<Image
Width="16"
Height="16"
Source="Images/Open.png" />
<Button Command="Open">
<Image Width="16" Height="16" Source="Images/Open.png" />
</Button>
<Separator />
<CheckBox IsChecked="{Binding ShowInternalApi}" ToolTip="Show internal types and members">
<Image Width="16" Height="16" Source="Images/PrivateInternal.png" />
</CheckBox>
<Separator />
<ComboBox Name="languageComboBox" DisplayMemberPath="Name" Width="50" SelectionChanged="LanguageComboBox_SelectionChanged" />
</ToolBar>
<!-- Main grid separating left pane (treeView) from main pane (textEditor) -->

1
ILSpy/MainWindow.xaml.cs

@ -25,6 +25,7 @@ using System.Windows; @@ -25,6 +25,7 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Threading;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.FlowAnalysis;
using ICSharpCode.TreeView;

2
ILSpy/NamespaceTreeNode.cs

@ -48,7 +48,7 @@ namespace ICSharpCode.ILSpy @@ -48,7 +48,7 @@ namespace ICSharpCode.ILSpy
public override FilterResult Filter(FilterSettings settings)
{
if (settings.SearchTermMatches(name))
return FilterResult.Match;
return FilterResult.MatchAndRecurse;
else
return FilterResult.Recurse;
}

2
ILSpy/ResourceListTreeNode.cs

@ -36,7 +36,7 @@ namespace ICSharpCode.ILSpy @@ -36,7 +36,7 @@ namespace ICSharpCode.ILSpy
public override FilterResult Filter(FilterSettings settings)
{
if (string.IsNullOrEmpty(settings.SearchTerm))
return FilterResult.Match;
return FilterResult.MatchAndRecurse;
else
return FilterResult.Recurse;
}

Loading…
Cancel
Save