diff --git a/DPackRx.Tests/Features/CodeBrowserViewModelTests.cs b/DPackRx.Tests/Features/CodeBrowserViewModelTests.cs index 0d9c8fc..0aa39df 100644 --- a/DPackRx.Tests/Features/CodeBrowserViewModelTests.cs +++ b/DPackRx.Tests/Features/CodeBrowserViewModelTests.cs @@ -102,15 +102,15 @@ private CodeBrowserViewModel GetViewModel() #region Tests - [TestCase("test", CodeModelFilterFlags.All, 2)] - [TestCase("test", CodeModelFilterFlags.Methods, 1)] - [TestCase("test", CodeModelFilterFlags.Properties, 1)] - [TestCase("test", CodeModelFilterFlags.ClassesInterfaces, 0)] - [TestCase("", CodeModelFilterFlags.All, 4)] - [TestCase("", CodeModelFilterFlags.Methods, 2)] - [TestCase("", CodeModelFilterFlags.Properties, 2)] - [TestCase("", CodeModelFilterFlags.ClassesInterfaces, 0)] - public void OnInitialize(string search, CodeModelFilterFlags flags, int expectedCount) + [TestCase("test", CodeModelFilterFlags.All, 2, null)] + [TestCase("test", CodeModelFilterFlags.Methods, 1, "methods")] + [TestCase("test", CodeModelFilterFlags.Properties, 1, "properties")] + [TestCase("test", CodeModelFilterFlags.ClassesInterfaces, 0, "classes and interfaces")] + [TestCase("", CodeModelFilterFlags.All, 4, null)] + [TestCase("", CodeModelFilterFlags.Methods, 2, "methods")] + [TestCase("", CodeModelFilterFlags.Properties, 2, "properties")] + [TestCase("", CodeModelFilterFlags.ClassesInterfaces, 0, "classes and interfaces")] + public void OnInitialize(string search, CodeModelFilterFlags flags, int expectedCount, string expectedTitle) { var viewModel = GetViewModel(); @@ -141,6 +141,8 @@ public void OnInitialize(string search, CodeModelFilterFlags flags, int expected Assert.That(viewModel.FileName, Is.EqualTo("test")); Assert.That(viewModel.Title, Is.Not.Null.And.Not.Empty); Assert.That(viewModel.Title, Contains.Substring(" - test")); + if (!string.IsNullOrEmpty(expectedTitle)) + Assert.That(viewModel.Title, Contains.Substring($" - {expectedTitle}")); _fileProcessorMock.Verify(p => p.GetMembers(ProcessorFlags.IncludeFileCodeModel, It.IsAny())); _optionsServiceMock.Verify(o => o.GetStringOption(viewModel.Feature, "File", string.Empty)); _optionsServiceMock.Verify(o => o.GetStringOption(viewModel.Feature, "Search", string.Empty)); diff --git a/DPackRx/Features/CodeBrowser/CodeBrowserViewModel.cs b/DPackRx/Features/CodeBrowser/CodeBrowserViewModel.cs index 0bf97e8..ebbf49e 100644 --- a/DPackRx/Features/CodeBrowser/CodeBrowserViewModel.cs +++ b/DPackRx/Features/CodeBrowser/CodeBrowserViewModel.cs @@ -82,7 +82,6 @@ public override void OnInitialize(object argument) throw new ArgumentException("Invalid initialization argument", nameof(argument)); this.FileName = _optionsService.GetStringOption(this.Feature, "File", this.FileName); - this.Title = $"USysWare Code Browser - {Path.GetFileName(this.FileName)}"; _search = _optionsService.GetStringOption(this.Feature, "Search", _search); this.Filter = (CodeModelFilterFlags)argument; var filter = (CodeModelFilterFlags)_optionsService.GetIntOption(this.Feature, "Filter", (int)this.Filter); @@ -262,6 +261,17 @@ private void ApplyMembers() _search = string.Empty; this.FileName = fileName; + string filter = null; + if (this.Filter == CodeModelFilterFlags.All) + filter = string.Empty; + else if (this.Filter.HasFlag(CodeModelFilterFlags.ClassesInterfaces)) + filter = "classes and interfaces"; + else if (this.Filter.HasFlag(CodeModelFilterFlags.Methods)) + filter = "methods"; + else if (this.Filter.HasFlag(CodeModelFilterFlags.Properties)) + filter = "properties"; + this.Title = $"USysWare Code Browser {(string.IsNullOrEmpty(filter) ? string.Empty : $"- {filter} ")}- {Path.GetFileName(this.FileName)}"; + _sourceMembers.Clear(); _sourceMembers.AddRange(members); // causes filter to be evaluated } diff --git a/DPackRx/Package/Beta.cs b/DPackRx/Package/Beta.cs index e8ef3d7..c69e123 100644 --- a/DPackRx/Package/Beta.cs +++ b/DPackRx/Package/Beta.cs @@ -8,7 +8,7 @@ namespace DPackRx.Package /// internal static class Beta { - public static readonly DateTime ExpirationDate = new DateTime(2020, 10, 19).AddHours(12); + public static readonly DateTime ExpirationDate = new DateTime(2020, 12, 7).AddHours(12); } #endif } \ No newline at end of file diff --git a/DPackRx/source.extension.vsixmanifest b/DPackRx/source.extension.vsixmanifest index 6ed4561..ecfd8fa 100644 --- a/DPackRx/source.extension.vsixmanifest +++ b/DPackRx/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + DPack Rx FREE tools collection designed to greatly increase developer's productivity, automate repetitive processes and expand upon some of Microsoft Visual Studio features. Visual Studio 2017 and 2019 are supported. https://github.com/usysware/dpack