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 {
get { return ShowApiLevel == ApiVisibility.PublicAndInternal; }
public bool ApiVisPublicOnly {
get { return showApiLevel == ApiVisibility.PublicOnly; }
set {
if (ShowApiLevel == ApiVisibility.PublicAndInternal) {
ShowApiLevel = ApiVisibility.PublicOnly;
} else {
ShowApiLevel = ApiVisibility.PublicAndInternal;
}
OnPropertyChanged(nameof(ShowInternalApi));
OnPropertyChanged(nameof(ShowAllApi));
if (value == (showApiLevel == ApiVisibility.PublicOnly)) return;
ShowApiLevel = ApiVisibility.PublicOnly;
OnPropertyChanged(nameof(ApiVisPublicOnly));
OnPropertyChanged(nameof(ApiVisPublicAndInternal));
OnPropertyChanged(nameof(ApiVisAll));
}
}
public bool ShowAllApi {
get { return ShowApiLevel == ApiVisibility.All; }
public bool ApiVisPublicAndInternal {
get { return showApiLevel == ApiVisibility.PublicAndInternal; }
set {
if (ShowApiLevel == ApiVisibility.All) {
ShowApiLevel = ApiVisibility.PublicOnly;
} else {
ShowApiLevel = ApiVisibility.All;
}
OnPropertyChanged(nameof(ShowInternalApi));
OnPropertyChanged(nameof(ShowAllApi));
if (value == (showApiLevel == ApiVisibility.PublicAndInternal)) return;
ShowApiLevel = ApiVisibility.PublicAndInternal;
OnPropertyChanged(nameof(ApiVisPublicOnly));
OnPropertyChanged(nameof(ApiVisPublicAndInternal));
OnPropertyChanged(nameof(ApiVisAll));
}
}
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)" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\PublicOnly.png" />
</ItemGroup>
<PropertyGroup>
<VCBasePath>$(MSBuildToolsPath)\..\..\..\VC\</VCBasePath>
<VCToolsVersionPropsFileNameDefault>Microsoft.VCToolsVersion.default.props</VCToolsVersionPropsFileNameDefault>

BIN
ILSpy/Images/PublicOnly.png

After

Width: 16  |  Height: 16  |  Size: 1.2 KiB

19
ILSpy/MainWindow.xaml

@ -53,15 +53,11 @@
<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._View}">
<MenuItem Header="{x:Static properties:Resources.Show_internalTypesMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ShowInternalApi}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="Images/PrivateInternal.png" />
</MenuItem.Icon>
<MenuItem Header="{x:Static properties:Resources.Show_publiconlyTypesMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ApiVisPublicOnly}">
</MenuItem>
<MenuItem Header="{x:Static properties:Resources.Show_allTypesAndMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ShowAllApi}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="Images/ShowAll.png" />
</MenuItem.Icon>
<MenuItem Header="{x:Static properties:Resources.Show_internalTypesMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ApiVisPublicAndInternal}">
</MenuItem>
<MenuItem Header="{x:Static properties:Resources.Show_allTypesAndMembers}" IsCheckable="True" IsChecked="{Binding FilterSettings.ApiVisAll}">
</MenuItem>
</MenuItem>
</Menu>
@ -85,10 +81,13 @@
<Separator />
<!-- 'Open' toolbar category is inserted here -->
<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" />
</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" />
</CheckBox>
<Separator />

22
ILSpy/Properties/Resources.Designer.cs

@ -1621,7 +1621,7 @@ namespace ICSharpCode.ILSpy.Properties {
}
/// <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>
public static string Show_internalTypesMembers {
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>
/// Looks up a localized string similar to Show all types and members.
/// </summary>
@ -1684,7 +1693,7 @@ namespace ICSharpCode.ILSpy.Properties {
}
/// <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>
public static string ShowInternalTypesMembers {
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>
/// Looks up a localized string similar to Show state after this step.
/// </summary>

10
ILSpy/Properties/Resources.resx

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