Browse Source

Tri-State ApiVisibility now reflected by three toolbar & menu items

Menu items: removed icon (it switching with checkmark was irritating)
pull/1704/head
Christoph Wille 6 years ago committed by Siegfried Pammer
parent
commit
0f7c86b87b
  1. 43
      ILSpy/FilterSettings.cs
  2. 4
      ILSpy/ILSpy.csproj
  3. BIN
      ILSpy/Images/PublicOnly.png
  4. 19
      ILSpy/MainWindow.xaml
  5. 22
      ILSpy/Properties/Resources.Designer.cs
  6. 10
      ILSpy/Properties/Resources.resx

43
ILSpy/FilterSettings.cs

@ -94,29 +94,36 @@ namespace ICSharpCode.ILSpy
} }
} }
public bool ShowInternalApi { public bool ApiVisPublicOnly {
get { return ShowApiLevel == ApiVisibility.PublicAndInternal; } get { return showApiLevel == ApiVisibility.PublicOnly; }
set { set {
if (ShowApiLevel == ApiVisibility.PublicAndInternal) { if (value == (showApiLevel == ApiVisibility.PublicOnly)) return;
ShowApiLevel = ApiVisibility.PublicOnly; ShowApiLevel = ApiVisibility.PublicOnly;
} else { OnPropertyChanged(nameof(ApiVisPublicOnly));
ShowApiLevel = ApiVisibility.PublicAndInternal; OnPropertyChanged(nameof(ApiVisPublicAndInternal));
} OnPropertyChanged(nameof(ApiVisAll));
OnPropertyChanged(nameof(ShowInternalApi));
OnPropertyChanged(nameof(ShowAllApi));
} }
} }
public bool ShowAllApi { public bool ApiVisPublicAndInternal {
get { return ShowApiLevel == ApiVisibility.All; } get { return showApiLevel == ApiVisibility.PublicAndInternal; }
set { set {
if (ShowApiLevel == ApiVisibility.All) { if (value == (showApiLevel == ApiVisibility.PublicAndInternal)) return;
ShowApiLevel = ApiVisibility.PublicOnly; ShowApiLevel = ApiVisibility.PublicAndInternal;
} else { OnPropertyChanged(nameof(ApiVisPublicOnly));
ShowApiLevel = ApiVisibility.All; OnPropertyChanged(nameof(ApiVisPublicAndInternal));
} OnPropertyChanged(nameof(ApiVisAll));
OnPropertyChanged(nameof(ShowInternalApi)); }
OnPropertyChanged(nameof(ShowAllApi)); }
public bool ApiVisAll {
get { return showApiLevel == ApiVisibility.All; }
set {
if (value == (showApiLevel == ApiVisibility.All)) return;
ShowApiLevel = ApiVisibility.All;
OnPropertyChanged(nameof(ApiVisPublicOnly));
OnPropertyChanged(nameof(ApiVisPublicAndInternal));
OnPropertyChanged(nameof(ApiVisAll));
} }
} }

4
ILSpy/ILSpy.csproj

@ -433,6 +433,10 @@
<None Include="@(Resource)" /> <None Include="@(Resource)" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Resource Include="Images\PublicOnly.png" />
</ItemGroup>
<PropertyGroup> <PropertyGroup>
<VCBasePath>$(MSBuildToolsPath)\..\..\..\VC\</VCBasePath> <VCBasePath>$(MSBuildToolsPath)\..\..\..\VC\</VCBasePath>
<VCToolsVersionPropsFileNameDefault>Microsoft.VCToolsVersion.default.props</VCToolsVersionPropsFileNameDefault> <VCToolsVersionPropsFileNameDefault>Microsoft.VCToolsVersion.default.props</VCToolsVersionPropsFileNameDefault>

BIN
ILSpy/Images/PublicOnly.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

19
ILSpy/MainWindow.xaml

@ -53,15 +53,11 @@
<Menu DockPanel.Dock="Top" Name="mainMenu" Height="23" KeyboardNavigation.TabNavigation="None"> <Menu DockPanel.Dock="Top" Name="mainMenu" Height="23" KeyboardNavigation.TabNavigation="None">
<MenuItem Header="{x:Static properties:Resources._File}" /> <!-- contents of file menu are added using MEF --> <MenuItem Header="{x:Static properties:Resources._File}" /> <!-- contents of file menu are added using MEF -->
<MenuItem Header="{x:Static properties:Resources._View}"> <MenuItem Header="{x:Static properties:Resources._View}">
<MenuItem Header="{x:Static properties:Resources.Show_internalTypesMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ShowInternalApi}"> <MenuItem Header="{x:Static properties:Resources.Show_publiconlyTypesMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ApiVisPublicOnly}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="Images/PrivateInternal.png" />
</MenuItem.Icon>
</MenuItem> </MenuItem>
<MenuItem Header="{x:Static properties:Resources.Show_allTypesAndMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ShowAllApi}"> <MenuItem Header="{x:Static properties:Resources.Show_internalTypesMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ApiVisPublicAndInternal}">
<MenuItem.Icon> </MenuItem>
<Image Width="16" Height="16" Source="Images/ShowAll.png" /> <MenuItem Header="{x:Static properties:Resources.Show_allTypesAndMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ApiVisAll}">
</MenuItem.Icon>
</MenuItem> </MenuItem>
</MenuItem> </MenuItem>
</Menu> </Menu>
@ -85,10 +81,13 @@
<Separator /> <Separator />
<!-- 'Open' toolbar category is inserted here --> <!-- 'Open' toolbar category is inserted here -->
<Separator /> <Separator />
<CheckBox IsChecked="{Binding FilterSettings.ShowInternalApi}" ToolTip="{x:Static properties:Resources.ShowInternalTypesMembers}"> <CheckBox IsChecked="{Binding FilterSettings.ApiVisPublicOnly}" ToolTip="{x:Static properties:Resources.ShowPublicOnlyTypesMembers}">
<Image Width="16" Height="16" Source="Images/PublicOnly.png" />
</CheckBox>
<CheckBox IsChecked="{Binding FilterSettings.ApiVisPublicAndInternal}" ToolTip="{x:Static properties:Resources.ShowInternalTypesMembers}">
<Image Width="16" Height="16" Source="Images/PrivateInternal.png" /> <Image Width="16" Height="16" Source="Images/PrivateInternal.png" />
</CheckBox> </CheckBox>
<CheckBox IsChecked="{Binding FilterSettings.ShowAllApi}" ToolTip="{x:Static properties:Resources.ShowAllTypesAndMembers}"> <CheckBox IsChecked="{Binding FilterSettings.ApiVisAll}" ToolTip="{x:Static properties:Resources.ShowAllTypesAndMembers}">
<Image Width="16" Height="16" Source="Images/ShowAll.png" /> <Image Width="16" Height="16" Source="Images/ShowAll.png" />
</CheckBox> </CheckBox>
<Separator /> <Separator />

22
ILSpy/Properties/Resources.Designer.cs generated

@ -1621,7 +1621,7 @@ namespace ICSharpCode.ILSpy.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Show _internal types and members. /// Looks up a localized string similar to Show public, private and internal.
/// </summary> /// </summary>
public static string Show_internalTypesMembers { public static string Show_internalTypesMembers {
get { get {
@ -1629,6 +1629,15 @@ namespace ICSharpCode.ILSpy.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Show only _public types and members.
/// </summary>
public static string Show_publiconlyTypesMembers {
get {
return ResourceManager.GetString("Show_publiconlyTypesMembers", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Show all types and members. /// Looks up a localized string similar to Show all types and members.
/// </summary> /// </summary>
@ -1684,7 +1693,7 @@ namespace ICSharpCode.ILSpy.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Show internal types and members. /// Looks up a localized string similar to Show public, private and internal.
/// </summary> /// </summary>
public static string ShowInternalTypesMembers { public static string ShowInternalTypesMembers {
get { get {
@ -1719,6 +1728,15 @@ namespace ICSharpCode.ILSpy.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Show only public types and members.
/// </summary>
public static string ShowPublicOnlyTypesMembers {
get {
return ResourceManager.GetString("ShowPublicOnlyTypesMembers", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Show state after this step. /// Looks up a localized string similar to Show state after this step.
/// </summary> /// </summary>

10
ILSpy/Properties/Resources.resx

@ -370,10 +370,10 @@
<value>You are using a nightly build newer than the latest release.</value> <value>You are using a nightly build newer than the latest release.</value>
</data> </data>
<data name="Show_internalTypesMembers" xml:space="preserve"> <data name="Show_internalTypesMembers" xml:space="preserve">
<value>Show _internal types and members</value> <value>Show public, private and internal</value>
</data> </data>
<data name="ShowInternalTypesMembers" xml:space="preserve"> <data name="ShowInternalTypesMembers" xml:space="preserve">
<value>Show internal types and members</value> <value>Show public, private and internal</value>
</data> </data>
<data name="StandBy" xml:space="preserve"> <data name="StandBy" xml:space="preserve">
<value>Stand by...</value> <value>Stand by...</value>
@ -754,4 +754,10 @@ Are you sure you want to continue?</value>
<data name="DecompilerSettings.RemoveDeadStores" xml:space="preserve"> <data name="DecompilerSettings.RemoveDeadStores" xml:space="preserve">
<value>Remove dead stores (use with caution!)</value> <value>Remove dead stores (use with caution!)</value>
</data> </data>
<data name="ShowPublicOnlyTypesMembers" xml:space="preserve">
<value>Show only public types and members</value>
</data>
<data name="Show_publiconlyTypesMembers" xml:space="preserve">
<value>Show only _public types and members</value>
</data>
</root> </root>
Loading…
Cancel
Save