From 0f7c86b87bdefb172085994be5e6e231bd50b1ba Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Wed, 14 Aug 2019 15:30:56 +0200 Subject: [PATCH] Tri-State ApiVisibility now reflected by three toolbar & menu items Menu items: removed icon (it switching with checkmark was irritating) --- ILSpy/FilterSettings.cs | 43 ++++++++++++++----------- ILSpy/ILSpy.csproj | 4 +++ ILSpy/Images/PublicOnly.png | Bin 0 -> 1221 bytes ILSpy/MainWindow.xaml | 19 ++++++----- ILSpy/Properties/Resources.Designer.cs | 22 +++++++++++-- ILSpy/Properties/Resources.resx | 10 ++++-- 6 files changed, 66 insertions(+), 32 deletions(-) create mode 100644 ILSpy/Images/PublicOnly.png diff --git a/ILSpy/FilterSettings.cs b/ILSpy/FilterSettings.cs index e784f1c3c..788c3cc1f 100644 --- a/ILSpy/FilterSettings.cs +++ b/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)); } } diff --git a/ILSpy/ILSpy.csproj b/ILSpy/ILSpy.csproj index dc5fc15fb..d8953ca45 100644 --- a/ILSpy/ILSpy.csproj +++ b/ILSpy/ILSpy.csproj @@ -433,6 +433,10 @@ + + + + $(MSBuildToolsPath)\..\..\..\VC\ Microsoft.VCToolsVersion.default.props diff --git a/ILSpy/Images/PublicOnly.png b/ILSpy/Images/PublicOnly.png new file mode 100644 index 0000000000000000000000000000000000000000..f78f2d5b2f4f268cd795b2832aec271adbd5a50d GIT binary patch literal 1221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJV{wqX6T`Z5GB1G~mUKs7M+SzC z{oH>NSs56Z83KGlT!G^IXKF2-RC{cJ;o0RDSJv4-I}rHxc*OUMNx!eA{lAs{|4#1z zyLtcb7yN%%^#4)u|K}AqPfP^r8U>>vFbqOq-V^P;zBe`EuO;P33Jz$oP` z@Q5sCVBk9h!i=ICUJXD&Cr=m05RKrYCmi`01O-?F7q=f - - - - + - - - - + + + @@ -85,10 +81,13 @@ - + + + + - + diff --git a/ILSpy/Properties/Resources.Designer.cs b/ILSpy/Properties/Resources.Designer.cs index b555a63a4..ebf4c503a 100644 --- a/ILSpy/Properties/Resources.Designer.cs +++ b/ILSpy/Properties/Resources.Designer.cs @@ -1621,7 +1621,7 @@ namespace ICSharpCode.ILSpy.Properties { } /// - /// Looks up a localized string similar to Show _internal types and members. + /// Looks up a localized string similar to Show public, private and internal. /// public static string Show_internalTypesMembers { get { @@ -1629,6 +1629,15 @@ namespace ICSharpCode.ILSpy.Properties { } } + /// + /// Looks up a localized string similar to Show only _public types and members. + /// + public static string Show_publiconlyTypesMembers { + get { + return ResourceManager.GetString("Show_publiconlyTypesMembers", resourceCulture); + } + } + /// /// Looks up a localized string similar to Show all types and members. /// @@ -1684,7 +1693,7 @@ namespace ICSharpCode.ILSpy.Properties { } /// - /// Looks up a localized string similar to Show internal types and members. + /// Looks up a localized string similar to Show public, private and internal. /// public static string ShowInternalTypesMembers { get { @@ -1719,6 +1728,15 @@ namespace ICSharpCode.ILSpy.Properties { } } + /// + /// Looks up a localized string similar to Show only public types and members. + /// + public static string ShowPublicOnlyTypesMembers { + get { + return ResourceManager.GetString("ShowPublicOnlyTypesMembers", resourceCulture); + } + } + /// /// Looks up a localized string similar to Show state after this step. /// diff --git a/ILSpy/Properties/Resources.resx b/ILSpy/Properties/Resources.resx index d98c8cdcc..e66e857ea 100644 --- a/ILSpy/Properties/Resources.resx +++ b/ILSpy/Properties/Resources.resx @@ -370,10 +370,10 @@ You are using a nightly build newer than the latest release. - Show _internal types and members + Show public, private and internal - Show internal types and members + Show public, private and internal Stand by... @@ -754,4 +754,10 @@ Are you sure you want to continue? Remove dead stores (use with caution!) + + Show only public types and members + + + Show only _public types and members + \ No newline at end of file