diff --git a/CHANGELOG.md b/CHANGELOG.md index b04acd44..56f4ccb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,34 @@ # Changelog -## vNext (10.5) +## vNext (10.6) These changes have not been released to the Visual Studio marketplace, but (if checked) are available in preview within the [CI build](http://vsixgallery.com/extension/4c82e17d-927e-42d2-8460-b473ac7df316/). -- [x] Features - -- [x] Fixes +- [ ] Features +- [ ] Fixes ## Previous Releases These are the changes to each version that has been released to the Visual Studio marketplace. +## 10.5 + +**2018-06-09** + +- [x] Features + - [x] [#477](https://github.com/codecadwallader/codemaid/pull/477) - Digging: New radial progress bar - thanks [Jammer77](https://github.com/Jammer77)! + - [x] [#506](https://github.com/codecadwallader/codemaid/pull/506) - Enable localization for Chinese - thanks [maikebing](https://github.com/maikebing)! + - [x] [#519](https://github.com/codecadwallader/codemaid/pull/519) - Simplify the code by removing unnecessary guids - thanks [heku](https://github.com/heku)! + - [x] [#525](https://github.com/codecadwallader/codemaid/pull/525) - Make all features switchable - thanks [heku](https://github.com/heku)! + - [x] [#545](https://github.com/codecadwallader/codemaid/pull/545) - Ignore comment lines starting with certain prefixes - thanks [willemduncan](https://github.com/willemduncan)! + +- [x] Fixes + - [x] [#479](https://github.com/codecadwallader/codemaid/pull/479) - Update XAML Styler integration mappings - thanks [grochocki](https://github.com/grochocki)! + - [x] [#496](https://github.com/codecadwallader/codemaid/pull/496) - Fix the .NET Framework minimum required version (which is v4.6) + - [x] [#541](https://github.com/codecadwallader/codemaid/pull/541) - Project file (.csproj) cleanup - thanks [heku](https://github.com/heku)! + - [x] [#546](https://github.com/codecadwallader/codemaid/pull/546) - Fix a setting that would leave a trailing white space when formatting comments - thanks [willemduncan](https://github.com/willemduncan)! + - [x] [#556](https://github.com/codecadwallader/codemaid/issues/556) - Partial fix reducing how long we will block waiting for a code model to be built. + ## 10.4 **2017-03-26** diff --git a/CodeMaid.IntegrationTests/CodeMaid.IntegrationTests.csproj b/CodeMaid.IntegrationTests/CodeMaid.IntegrationTests.csproj index 04c78834..3ca64c5d 100644 --- a/CodeMaid.IntegrationTests/CodeMaid.IntegrationTests.csproj +++ b/CodeMaid.IntegrationTests/CodeMaid.IntegrationTests.csproj @@ -16,7 +16,7 @@ $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages False UnitTest - + latest true diff --git a/CodeMaid.IntegrationTests/DialogTests.cs b/CodeMaid.IntegrationTests/DialogTests.cs index a6b2ed4d..c11b4574 100644 --- a/CodeMaid.IntegrationTests/DialogTests.cs +++ b/CodeMaid.IntegrationTests/DialogTests.cs @@ -21,7 +21,7 @@ public void ShowAboutTest() { dialogBoxPurger.Start(); - var aboutCommand = new CommandID(PackageGuids.GuidCodeMaidCommandAbout, PackageIds.CmdIDCodeMaidAbout); + var aboutCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidAbout); TestUtils.ExecuteCommand(aboutCommand); } finally @@ -43,7 +43,7 @@ public void ShowConfigurationTest() { dialogBoxPurger.Start(); - var configurationCommand = new CommandID(PackageGuids.GuidCodeMaidCommandOptions, PackageIds.CmdIDCodeMaidOptions); + var configurationCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidOptions); TestUtils.ExecuteCommand(configurationCommand); } finally diff --git a/CodeMaid.IntegrationTests/Sorting/SortAtBottomTests.cs b/CodeMaid.IntegrationTests/Sorting/SortAtBottomTests.cs index dee81732..b26ab1dd 100644 --- a/CodeMaid.IntegrationTests/Sorting/SortAtBottomTests.cs +++ b/CodeMaid.IntegrationTests/Sorting/SortAtBottomTests.cs @@ -55,7 +55,7 @@ private static void RunSort(Document document) textDocument.Selection.EndOfDocument(); textDocument.Selection.LineUp(true, 4); - var sortCommand = new CommandID(PackageGuids.GuidCodeMaidCommandSortLines, PackageIds.CmdIDCodeMaidSortLines); + var sortCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSortLines); TestUtils.ExecuteCommand(sortCommand); } diff --git a/CodeMaid.IntegrationTests/Sorting/SortAtTopTests.cs b/CodeMaid.IntegrationTests/Sorting/SortAtTopTests.cs index 181746ff..e1cdcb0e 100644 --- a/CodeMaid.IntegrationTests/Sorting/SortAtTopTests.cs +++ b/CodeMaid.IntegrationTests/Sorting/SortAtTopTests.cs @@ -55,7 +55,7 @@ private static void RunSort(Document document) textDocument.Selection.StartOfDocument(); textDocument.Selection.LineDown(true, 4); - var sortCommand = new CommandID(PackageGuids.GuidCodeMaidCommandSortLines, PackageIds.CmdIDCodeMaidSortLines); + var sortCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSortLines); TestUtils.ExecuteCommand(sortCommand); } diff --git a/CodeMaid.IntegrationTests/Sorting/SortNoChangeTests.cs b/CodeMaid.IntegrationTests/Sorting/SortNoChangeTests.cs index 33b938a5..e47acf28 100644 --- a/CodeMaid.IntegrationTests/Sorting/SortNoChangeTests.cs +++ b/CodeMaid.IntegrationTests/Sorting/SortNoChangeTests.cs @@ -47,7 +47,7 @@ private static void RunSort(Document document) var textDocument = TestUtils.GetTextDocument(document); textDocument.Selection.SelectAll(); - var sortCommand = new CommandID(PackageGuids.GuidCodeMaidCommandSortLines, PackageIds.CmdIDCodeMaidSortLines); + var sortCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSortLines); TestUtils.ExecuteCommand(sortCommand); } diff --git a/CodeMaid.IntegrationTests/ToolWindowTests.cs b/CodeMaid.IntegrationTests/ToolWindowTests.cs index 04944d7f..5f6e7460 100644 --- a/CodeMaid.IntegrationTests/ToolWindowTests.cs +++ b/CodeMaid.IntegrationTests/ToolWindowTests.cs @@ -15,7 +15,7 @@ public void ShowBuildProgressTest() { UIThreadInvoker.Invoke(new Action(() => { - var buildProgressToolWindowCommand = new CommandID(PackageGuids.GuidCodeMaidCommandBuildProgressToolWindow, PackageIds.CmdIDCodeMaidBuildProgressToolWindow); + var buildProgressToolWindowCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidBuildProgressToolWindow); TestUtils.ExecuteCommand(buildProgressToolWindowCommand); Assert.IsTrue(TestUtils.CanFindToolwindow(PackageGuids.GuidCodeMaidToolWindowBuildProgress)); @@ -28,7 +28,7 @@ public void ShowSpadeTest() { UIThreadInvoker.Invoke(new Action(() => { - var spadeToolWindowCommand = new CommandID(PackageGuids.GuidCodeMaidCommandSpadeToolWindow, PackageIds.CmdIDCodeMaidSpadeToolWindow); + var spadeToolWindowCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeToolWindow); TestUtils.ExecuteCommand(spadeToolWindowCommand); Assert.IsTrue(TestUtils.CanFindToolwindow(PackageGuids.GuidCodeMaidToolWindowSpade)); diff --git a/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj b/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj index 1beaa813..0bb24d65 100644 --- a/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj +++ b/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj @@ -16,7 +16,7 @@ $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages False UnitTest - + latest true @@ -113,11 +113,13 @@ + + diff --git a/CodeMaid.UnitTests/Formatting/CommentFormatHelper.cs b/CodeMaid.UnitTests/Formatting/CommentFormatHelper.cs index 27dca280..60e553c8 100644 --- a/CodeMaid.UnitTests/Formatting/CommentFormatHelper.cs +++ b/CodeMaid.UnitTests/Formatting/CommentFormatHelper.cs @@ -1,9 +1,7 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.Helpers; using SteveCadwallader.CodeMaid.Model.Comments; using System; using System.Collections.Generic; -using System.Xml.Linq; namespace SteveCadwallader.CodeMaid.UnitTests.Formatting { @@ -38,11 +36,7 @@ public static string Format(string text) public static string Format(string text, string prefix) { - var xml = XElement.Parse($"{text}"); - var line = new CommentLineXml(xml); - var regex = CodeCommentHelper.GetCommentRegex(CodeLanguage.CSharp, !string.IsNullOrEmpty(prefix)); - var formatter = new CommentFormatter(line, prefix, 4, regex); - return formatter.ToString(); + return CodeComment.FormatXml(text, prefix); } } } \ No newline at end of file diff --git a/CodeMaid.UnitTests/Formatting/IgnorePrefixesTests.cs b/CodeMaid.UnitTests/Formatting/IgnorePrefixesTests.cs new file mode 100644 index 00000000..79a570f3 --- /dev/null +++ b/CodeMaid.UnitTests/Formatting/IgnorePrefixesTests.cs @@ -0,0 +1,71 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using SteveCadwallader.CodeMaid.Properties; +using System; + +namespace SteveCadwallader.CodeMaid.UnitTests.Formatting +{ + /// + /// Test for the ignoring of comments lines starting with certain prefixes. + /// + [TestClass] + public class IgnorePrefixesTests + { + [TestInitialize] + public void TestInitialize() + { + Settings.Default.Reset(); + } + + [TestMethod] + [TestCategory("Formatting UnitTests")] + public void IgnorePrefixesTests_DoesNotWrapSingleLine() + { + Settings.Default.Formatting_CommentWrapColumn = 30; + CommentFormatHelper.AssertEqualAfterFormat(@"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit."); + } + + [TestMethod] + [TestCategory("Formatting UnitTests")] + public void IgnorePrefixesTests_DoesNotWrapLineInsideComment() + { + var input = + "Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + + "TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + + "Lorem ipsum dolor sit amet, consectetur adipiscing elit."; + + // Expect all lines to be wrapped except for the one starting with "TODO". + var expected = + "Lorem ipsum dolor sit amet," + Environment.NewLine + + "consectetur adipiscing elit." + Environment.NewLine + + "TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + + "Lorem ipsum dolor sit amet," + Environment.NewLine + + "consectetur adipiscing elit."; + + Settings.Default.Formatting_CommentWrapColumn = 30; + CommentFormatHelper.AssertEqualAfterFormat(input, expected); + } + + [TestMethod] + [TestCategory("Formatting UnitTests")] + public void IgnorePrefixesTests_DoesNotCombineSubsequentLines() + { + var input = + "Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + + "TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + + "TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + + "Lorem ipsum dolor sit amet, consectetur adipiscing elit."; + + // Expect every "ignored" line to stay on it's own. + var expected = + "Lorem ipsum dolor sit amet," + Environment.NewLine + + "consectetur adipiscing elit." + Environment.NewLine + + "TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + + "TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine + + "Lorem ipsum dolor sit amet," + Environment.NewLine + + "consectetur adipiscing elit."; + + Settings.Default.Formatting_CommentWrapColumn = 30; + CommentFormatHelper.AssertEqualAfterFormat(input, expected); + } + } +} \ No newline at end of file diff --git a/CodeMaid.UnitTests/Formatting/XmlFormattingTests.cs b/CodeMaid.UnitTests/Formatting/XmlFormattingTests.cs index 440b49d5..1876d812 100644 --- a/CodeMaid.UnitTests/Formatting/XmlFormattingTests.cs +++ b/CodeMaid.UnitTests/Formatting/XmlFormattingTests.cs @@ -43,6 +43,53 @@ public void XmlFormattingTests_AddSpaceToTagContent() CommentFormatHelper.AssertEqualAfterFormat(input, expected); } + [TestMethod] + [TestCategory("Formatting UnitTests")] + public void XmlFormattingTests_AddSpaceToTagContentWithSelfClosingTag() + { + var input = ""; + var expected = " "; + + Settings.Default.Formatting_CommentXmlSplitSummaryTagToMultipleLines = false; + Settings.Default.Formatting_CommentXmlSpaceTags = true; + + CommentFormatHelper.AssertEqualAfterFormat(input, expected); + } + + [TestMethod] + [TestCategory("Formatting UnitTests")] + public void XmlFormattingTests_AddSpaceToTagContentWithSelfClosingTagMultiline() + { + var input = ""; + var expected = + "" + Environment.NewLine + + "" + Environment.NewLine + + ""; + + Settings.Default.Formatting_CommentXmlSplitSummaryTagToMultipleLines = true; + Settings.Default.Formatting_CommentXmlSpaceTags = true; + + CommentFormatHelper.AssertEqualAfterFormat(input, expected); + } + + [TestMethod] + [TestCategory("Formatting UnitTests")] + public void XmlFormattingTests_AddSpaceToTagContentShouldLeaveNoTrailingWhitespace() + { + var input = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."; + var expected = + "" + Environment.NewLine + + "Lorem ipsum dolor sit amet," + Environment.NewLine + + "consectetur adipiscing elit." + Environment.NewLine + + ""; + + Settings.Default.Formatting_CommentWrapColumn = 30; + Settings.Default.Formatting_CommentXmlSplitSummaryTagToMultipleLines = true; + Settings.Default.Formatting_CommentXmlSpaceTags = true; + + CommentFormatHelper.AssertEqualAfterFormat(input, expected); + } + [TestMethod] [TestCategory("Formatting UnitTests")] public void XmlFormattingTests_AllRootLevelTagsOnNewLine() diff --git a/CodeMaid.UnitTests/Helpers/CodeItemTypeComparerTests.cs b/CodeMaid.UnitTests/Helpers/CodeItemTypeComparerTests.cs index f8471836..0fa12a30 100644 --- a/CodeMaid.UnitTests/Helpers/CodeItemTypeComparerTests.cs +++ b/CodeMaid.UnitTests/Helpers/CodeItemTypeComparerTests.cs @@ -95,4 +95,4 @@ private static CodeItemMethod CreateExplicitMethod(string interfaceName, string return method; } } -} +} \ No newline at end of file diff --git a/CodeMaid.UnitTests/Helpers/SettingsMonitorTests.cs b/CodeMaid.UnitTests/Helpers/SettingsMonitorTests.cs new file mode 100644 index 00000000..d6209c64 --- /dev/null +++ b/CodeMaid.UnitTests/Helpers/SettingsMonitorTests.cs @@ -0,0 +1,125 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using SteveCadwallader.CodeMaid.Helpers; +using SteveCadwallader.CodeMaid.Properties; +using System.Linq; + +namespace SteveCadwallader.CodeMaid.UnitTests.Helpers +{ + [TestClass] + public class SettingsMonitorTests + { + [TestInitialize] + public void TestInitialize() + { + Settings.Default.Reset(); + } + + [TestMethod] + public void CallbackShouldBeCalledAtOnce() + { + var monitor = new SettingsMonitor(Settings.Default); + + int callbackTimes = 0; + monitor.Watch(s => s.Feature_CleanupAllCode, _ => callbackTimes++); + + Assert.AreEqual(/*Initial Call Times*/1, callbackTimes); + } + + [TestMethod] + public void CallbackShouldNotBeCalledIfSettingNotChanged() + { + Settings.Default.Feature_CleanupAllCode = false; + var monitor = new SettingsMonitor(Settings.Default); + + bool? value = null; + int callbackTimes = 0; + monitor.Watch(s => s.Feature_CleanupAllCode, v => + { + value = v; + callbackTimes++; + }); + + Settings.Default.Feature_CleanupAllCode = false; + Settings.Default.Save(); + + Assert.AreEqual(/*Initial Call Times*/1 + 0, callbackTimes); + Assert.AreEqual(Settings.Default.Feature_CleanupAllCode, value); + } + + [TestMethod] + public void CallbackShouldBeCalledOnceSettingChanged() + { + Settings.Default.Feature_CleanupAllCode = false; + var monitor = new SettingsMonitor(Settings.Default); + + bool? value = null; + int callbackTimes = 0; + monitor.Watch(s => s.Feature_CleanupAllCode, v => + { + value = v; + callbackTimes++; + }); + + Settings.Default.Feature_CleanupAllCode = true; + Settings.Default.Save(); + + Assert.AreEqual(/*Initial Call Times*/ 1 + 1, callbackTimes); + Assert.AreEqual(Settings.Default.Feature_CleanupAllCode, value); + } + + [TestMethod] + public void AllCallbacksShouldBeCalledOnceSettingChanged() + { + Settings.Default.Feature_CleanupAllCode = false; + var monitor = new SettingsMonitor(Settings.Default); + + bool? value1 = null, value2 = null; + int callbackTimes1 = 0, callbackTimes2 = 0; + monitor.Watch(s => s.Feature_CleanupAllCode, v => + { + value1 = v; + callbackTimes1++; + }); + monitor.Watch(s => s.Feature_CleanupAllCode, v => + { + value2 = v; + callbackTimes2++; + }); + + Settings.Default.Feature_CleanupAllCode = true; + Settings.Default.Save(); + + Assert.AreEqual(/*Initial Call Times*/1 + 1, callbackTimes1); + Assert.AreEqual(/*Initial Call Times*/1 + 1, callbackTimes2); + Assert.AreEqual(Settings.Default.Feature_CleanupAllCode, value1); + Assert.AreEqual(Settings.Default.Feature_CleanupAllCode, value2); + } + + [TestMethod] + public void CallbackShouldBeCalledOnceAnyWatchedSettingChanged() + { + Settings.Default.Feature_CleanupAllCode = false; + Settings.Default.Feature_CleanupOpenCode = false; + Settings.Default.Feature_CleanupSelectedCode = true; + var monitor = new SettingsMonitor(Settings.Default); + + bool[] values = null; + int callbackTimes = 0; + monitor.Watch(new[]{ + nameof(Settings.Default.Feature_CleanupAllCode), + nameof(Settings.Default.Feature_CleanupOpenCode), + nameof(Settings.Default.Feature_CleanupSelectedCode) + }, v => + { + values = v; + callbackTimes++; + }); + + Settings.Default.Feature_CleanupSelectedCode = false; + Settings.Default.Save(); + + Assert.AreEqual(/*Initial Call Times*/1 + 1, callbackTimes); + Assert.IsTrue(values.All(v => v == false)); + } + } +} \ No newline at end of file diff --git a/CodeMaid.UnitTests/SpadeTest.cs b/CodeMaid.UnitTests/SpadeTest.cs index 02f52f6a..65888d6f 100644 --- a/CodeMaid.UnitTests/SpadeTest.cs +++ b/CodeMaid.UnitTests/SpadeTest.cs @@ -23,7 +23,7 @@ public void ShowSpadeToolWindow() var package = CodeMaidPackageHelper.CreateInitializedPackage(); // Retrieve the command. - var command = package.MenuCommandService.FindCommand(new CommandID(PackageGuids.GuidCodeMaidCommandSpadeToolWindow, PackageIds.CmdIDCodeMaidSpadeToolWindow)); + var command = package.MenuCommandService.FindCommand(new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeToolWindow)); // Invoke the command. command.Invoke(); diff --git a/CodeMaid.config b/CodeMaid.config index 7c7e6b73..12830564 100644 --- a/CodeMaid.config +++ b/CodeMaid.config @@ -16,6 +16,12 @@ False + + True + + + True + \ No newline at end of file diff --git a/CodeMaid/CodeMaid.cs b/CodeMaid/CodeMaid.cs index c8eee1cc..a7887daf 100644 --- a/CodeMaid/CodeMaid.cs +++ b/CodeMaid/CodeMaid.cs @@ -17,94 +17,7 @@ internal sealed partial class PackageGuids public const string GuidCodeMaidToolWindowBuildProgressString = "260978c3-582c-487d-ab12-c1fdde07c578"; public const string GuidCodeMaidToolWindowSpadeString = "75d09b86-471e-4b30-8720-362d13ad0a45"; public const string GuidCodeMaidOutputPaneString = "4e7ba904-9311-4dd0-abe5-a61c1739780f"; - public const string GuidCodeMaidMenuBaseGroupString = "186512ff-6c4e-42c9-b9a1-032f35109993"; - public const string GuidCodeMaidMenuCleanupGroupString = "eb1c95fd-1b99-47ab-913a-62e7f69a0319"; - public const string GuidCodeMaidMenuDocumentGroupString = "5c29c8d8-681c-4cf3-8481-cc3ee484639a"; - public const string GuidCodeMaidMenuExtendGroupString = "4527c6ae-82e7-4fd8-9755-43bfbcfd2a61"; - public const string GuidCodeMaidMenuMetaGroupString = "590f8d08-eb82-444c-bee2-4652d3f30145"; - public const string GuidCodeMaidMenuSolutionExplorerGroupString = "d69f1580-274f-4d12-b13a-c365c759de66"; - public const string GuidCodeMaidMenuVisualizeGroupString = "a4ef7624-6477-4860-85bc-46564429f935"; - public const string GuidCodeMaidToolbarSpadeBaseGroupString = "93e0e5d3-d335-4c12-ae8b-bccccdcd1eda"; - public const string GuidCodeMaidToolbarSpadeRefreshGroupString = "c4640933-0ac0-485c-875f-4aaa94fdd8d0"; - public const string GuidCodeMaidToolbarSpadeSortOrderGroupString = "e5e5ca6a-7cdd-473f-9d55-9d726e220bd3"; - public const string GuidCodeMaidToolbarSpadeMetaGroupString = "e56ddcf8-dc5f-45cb-84f5-c88d2c8e556b"; - public const string GuidCodeMaidContextSpadeBaseGroupString = "a8c6d617-bb41-4357-b0a1-175e7a04cc5a"; - public const string GuidCodeMaidContextSpadeFindGroupString = "4e3fd2e6-4cde-497c-a899-eee7e53c8852"; - public const string GuidCodeMaidContextSpadeDeleteGroupString = "e4abf3d9-e332-4c5d-97a9-4ac09395c28f"; - public const string GuidCodeMaidContextSpadeInsertGroupString = "707d9532-5392-4b5f-a36d-b88c583eb732"; - public const string GuidCodeMaidContextSolutionNodeGroupString = "eda37cf1-ff29-46aa-ba07-05abf7ba6596"; - public const string GuidCodeMaidContextSolutionFolderGroupString = "39de3da3-f28c-41fc-85c8-6d0fa801f3f1"; - public const string GuidCodeMaidContextProjectNodeGroupString = "a04159ed-c5ee-4146-954a-4e662b297513"; - public const string GuidCodeMaidContextFolderNodeGroupString = "9979d6f0-4af6-446a-a9ff-b84e27452435"; - public const string GuidCodeMaidContextItemNodeGroupString = "36669853-51f0-4da1-828d-d43d67b8450c"; - public const string GuidCodeMaidContextCrossProjectSolutionProjectGroupString = "3cbd1bde-1874-44c5-83e4-371b0a767d4b"; - public const string GuidCodeMaidContextCrossProjectSolutionItemGroupString = "fd769de2-2836-4027-9f8e-dee5690521d9"; - public const string GuidCodeMaidContextCrossProjectProjectItemGroupString = "623f520b-6640-432e-b61b-12b6b0be3663"; - public const string GuidCodeMaidContextCrossProjectMultiProjectGroupString = "5662bd3b-b933-4c44-b6cc-585688ed31c5"; - public const string GuidCodeMaidContextCrossProjectMultiItemGroupString = "adc86bfa-64b0-4d80-b3c8-59ac96a1b81e"; - public const string GuidCodeMaidContextCrossProjectMultiSolutionFolderGroupString = "aab9ce77-df9e-4235-a5fd-27a247b49760"; - public const string GuidCodeMaidContextCrossProjectMultiProjectFolderGroupString = "d6785fff-23de-4fc1-8e5a-e044ff685f1d"; - public const string GuidCodeMaidContextDocumentTabGroupString = "9cba7ef0-ce80-42bb-9f25-c69a9710d328"; - public const string GuidCodeMaidContextASPXWindowGroupString = "d4cee201-6b18-4265-8693-a0cb38cf070b"; - public const string GuidCodeMaidContextASPXCodeWindowGroupString = "9c3012ad-61b1-4272-9ea2-5c07e33a9e2f"; - public const string GuidCodeMaidContextCodeWindowGroupString = "29039753-26f9-4548-b81c-d7baa5ebc661"; - public const string GuidCodeMaidContextCSSWindowGroupString = "5c88b2b2-24c7-4ff5-b16c-19f01e46a229"; - public const string GuidCodeMaidContextCSSDocumentGroupString = "8b375766-4cfd-4a2d-9e15-a535304efe2b"; - public const string GuidCodeMaidContextHTMLWindowGroupString = "248aaae5-8d3e-4914-9cd9-89c95941965a"; - public const string GuidCodeMaidContextHTMLDocumentGroupString = "5d667016-1652-4c9e-b57e-66c94ba59f19"; - public const string GuidCodeMaidContextJSONDocumentGroupString = "bdfc1abc-a4d2-41ed-8567-013286b56fff"; - public const string GuidCodeMaidContextScriptWindowGroupString = "b6343c4a-01bd-4a5e-b1fb-9a8a6203c74c"; - public const string GuidCodeMaidContextXAMLWindowGroupString = "b362d22f-6a03-4247-aaf9-bfc02f81d41b"; - public const string GuidCodeMaidContextASPXWindowMenuString = "aa0e9e4f-11f4-44f9-a0a9-b3ba5ad2117d"; - public const string GuidCodeMaidContextASPXCodeWindowMenuString = "5e9cf46a-e9b7-41c2-b041-40d11de2109c"; - public const string GuidCodeMaidContextCodeWindowMenuString = "2407a356-0df5-444c-ab30-0f3315bfb412"; - public const string GuidCodeMaidContextCSSWindowMenuString = "c9d5d306-597c-448a-bb51-fc97726f3776"; - public const string GuidCodeMaidContextCSSDocumentMenuString = "bdc687d2-cb59-4fa6-ad02-6c30f6ff481f"; - public const string GuidCodeMaidContextHTMLWindowMenuString = "b38d6415-8521-4b0c-9a93-1ab4cb049a53"; - public const string GuidCodeMaidContextHTMLDocumentMenuString = "bf16b6c8-fa53-4e82-bff3-38774bd5fc51"; - public const string GuidCodeMaidContextJSONDocumentMenuString = "ca93db91-b073-4656-baec-dfe551ab58fb"; - public const string GuidCodeMaidContextScriptWindowMenuString = "d4a4e92c-c45e-41b2-82e0-69ecb72889c8"; - public const string GuidCodeMaidContextXAMLWindowMenuString = "483bb2c8-b8d4-43c5-a3d5-7bdcbf5772fb"; - public const string GuidCodeMaidContextASPXWindowSubGroupString = "b22f3759-9a95-4954-b2ff-26813d8a2e3d"; - public const string GuidCodeMaidContextASPXCodeWindowSubGroupString = "7f281cda-0728-455a-9512-2ed63c424423"; - public const string GuidCodeMaidContextCodeWindowSubGroupString = "038e98da-e31f-4e55-bf95-8aa8627420f8"; - public const string GuidCodeMaidContextCSSWindowSubGroupString = "3e54b869-d473-4c52-8b79-5391bf87161f"; - public const string GuidCodeMaidContextCSSDocumentSubGroupString = "97870d60-97fe-4983-9378-325917a09842"; - public const string GuidCodeMaidContextHTMLWindowSubGroupString = "322bf642-99c2-47c2-811d-9d22dae9745e"; - public const string GuidCodeMaidContextHTMLDocumentSubGroupString = "2f85fed9-d46f-4342-b9d2-53b1b13d7fa8"; - public const string GuidCodeMaidContextJSONDocumentSubGroupString = "ab7eac96-d4ef-4ef5-ab3a-af8b7a237cd1"; - public const string GuidCodeMaidContextScriptWindowSubGroupString = "471b4d49-0e00-433e-b343-cc29ddac5f0c"; - public const string GuidCodeMaidContextXAMLWindowSubGroupString = "114b9d10-7081-4923-bb62-1028b4a0feb1"; - public const string GuidCodeMaidCommandAboutString = "369b04df-0688-4074-911d-d0d6c6a31632"; - public const string GuidCodeMaidCommandBuildProgressToolWindowString = "857ff04f-140c-47b1-b10b-dca6154ec26a"; - public const string GuidCodeMaidCommandCleanupActiveCodeString = "36de540f-25cb-4151-957f-d63a5a3a10a7"; - public const string GuidCodeMaidCommandCleanupAllCodeString = "eb2efdb6-2efe-405c-94af-383d36ad58dd"; - public const string GuidCodeMaidCommandCleanupOpenCodeString = "4e6a8a94-e888-4fa8-aae8-d6375f395e29"; - public const string GuidCodeMaidCommandCleanupSelectedCodeString = "b2979ac6-2853-442c-8df6-21637af5130e"; - public const string GuidCodeMaidCommandCloseAllReadOnlyString = "170a0d22-19ea-452c-839a-fb33535abbb7"; - public const string GuidCodeMaidCommandCollapseAllSolutionExplorerString = "f0b58f42-6f6e-49db-8787-411979a4a4e3"; - public const string GuidCodeMaidCommandCollapseSelectedSolutionExplorerString = "ed5ec7f2-c011-43c4-9a02-4f7fb907c734"; - public const string GuidCodeMaidCommandCommentFormatString = "2a7fccc9-311c-4725-b1c1-f2d1a2fffe7d"; - public const string GuidCodeMaidCommandFindInSolutionExplorerString = "9e7a4c5b-5de4-418c-8ede-71fcfa4e811f"; - public const string GuidCodeMaidCommandJoinLinesString = "7912f0a2-ada9-4888-9d2f-cde09cd310c6"; - public const string GuidCodeMaidCommandOptionsString = "56718f89-01d2-4405-99b5-4aa665af5947"; - public const string GuidCodeMaidCommandReadOnlyToggleString = "f8a69cbc-1c88-4229-8a28-eac0e7e55c30"; - public const string GuidCodeMaidCommandRemoveRegionString = "88438672-b9f2-422c-83e8-706f89f33d80"; - public const string GuidCodeMaidCommandReorganizeActiveCodeString = "60bd7c93-ff19-4351-8d2f-8761bdfc6a2a"; - public const string GuidCodeMaidCommandSettingCleanupOnSaveString = "411f786c-cf13-4f96-82ae-89d2a1d4f5a1"; - public const string GuidCodeMaidCommandSortLinesString = "e74645b3-7248-4001-ac8c-085b24908fee"; - public const string GuidCodeMaidCommandSpadeContextDeleteString = "d8312056-c902-4d26-9f12-b4bb60db0365"; - public const string GuidCodeMaidCommandSpadeContextFindReferencesString = "9ed89f6a-ab37-487a-8beb-d3c586d76a47"; - public const string GuidCodeMaidCommandSpadeContextInsertRegionString = "bc52d3da-030d-4d4b-b2c6-4c86b6805b2e"; - public const string GuidCodeMaidCommandSpadeContextRemoveRegionString = "502c000f-9afa-4c6a-af01-4d64d756733e"; - public const string GuidCodeMaidCommandSpadeOptionsString = "d068f0d3-267c-45b5-a02f-14f3422b8540"; - public const string GuidCodeMaidCommandSpadeRefreshString = "6e26b076-d635-4a6e-82a8-ba10483f5414"; - public const string GuidCodeMaidCommandSpadeSearchString = "d2586ad7-b0c0-4421-a42c-1b95d943cfa4"; - public const string GuidCodeMaidCommandSpadeSortOrderAlphaString = "96d3277b-ef42-45a0-ab4e-199068aee37a"; - public const string GuidCodeMaidCommandSpadeSortOrderFileString = "f415e355-9e84-40d4-9162-0d1035fed5ad"; - public const string GuidCodeMaidCommandSpadeSortOrderTypeString = "a59af09e-4c0f-4790-a954-3d967adcf216"; - public const string GuidCodeMaidCommandSpadeToolWindowString = "aaf6a75d-2ccc-4081-b1ab-76306653807c"; - public const string GuidCodeMaidCommandSwitchFileString = "8cd97d41-8750-4dbb-9e89-eaa91620b078"; + public const string GuidCodeMaidMenuSetString = "369b04df-0688-4074-911d-d0d6c6a31632"; public const string GuidImageCleanupString = "54aa78c8-285a-4166-9eba-369dde5d787e"; public const string GuidImageCleanupAllString = "e3d926ae-03d7-4c69-8226-440eeddab292"; public const string GuidImageCloseLockedString = "02ee894b-084c-4ccb-8a67-5f236b5df68b"; @@ -135,94 +48,7 @@ internal sealed partial class PackageGuids public static Guid GuidCodeMaidToolWindowBuildProgress = new Guid(GuidCodeMaidToolWindowBuildProgressString); public static Guid GuidCodeMaidToolWindowSpade = new Guid(GuidCodeMaidToolWindowSpadeString); public static Guid GuidCodeMaidOutputPane = new Guid(GuidCodeMaidOutputPaneString); - public static Guid GuidCodeMaidMenuBaseGroup = new Guid(GuidCodeMaidMenuBaseGroupString); - public static Guid GuidCodeMaidMenuCleanupGroup = new Guid(GuidCodeMaidMenuCleanupGroupString); - public static Guid GuidCodeMaidMenuDocumentGroup = new Guid(GuidCodeMaidMenuDocumentGroupString); - public static Guid GuidCodeMaidMenuExtendGroup = new Guid(GuidCodeMaidMenuExtendGroupString); - public static Guid GuidCodeMaidMenuMetaGroup = new Guid(GuidCodeMaidMenuMetaGroupString); - public static Guid GuidCodeMaidMenuSolutionExplorerGroup = new Guid(GuidCodeMaidMenuSolutionExplorerGroupString); - public static Guid GuidCodeMaidMenuVisualizeGroup = new Guid(GuidCodeMaidMenuVisualizeGroupString); - public static Guid GuidCodeMaidToolbarSpadeBaseGroup = new Guid(GuidCodeMaidToolbarSpadeBaseGroupString); - public static Guid GuidCodeMaidToolbarSpadeRefreshGroup = new Guid(GuidCodeMaidToolbarSpadeRefreshGroupString); - public static Guid GuidCodeMaidToolbarSpadeSortOrderGroup = new Guid(GuidCodeMaidToolbarSpadeSortOrderGroupString); - public static Guid GuidCodeMaidToolbarSpadeMetaGroup = new Guid(GuidCodeMaidToolbarSpadeMetaGroupString); - public static Guid GuidCodeMaidContextSpadeBaseGroup = new Guid(GuidCodeMaidContextSpadeBaseGroupString); - public static Guid GuidCodeMaidContextSpadeFindGroup = new Guid(GuidCodeMaidContextSpadeFindGroupString); - public static Guid GuidCodeMaidContextSpadeDeleteGroup = new Guid(GuidCodeMaidContextSpadeDeleteGroupString); - public static Guid GuidCodeMaidContextSpadeInsertGroup = new Guid(GuidCodeMaidContextSpadeInsertGroupString); - public static Guid GuidCodeMaidContextSolutionNodeGroup = new Guid(GuidCodeMaidContextSolutionNodeGroupString); - public static Guid GuidCodeMaidContextSolutionFolderGroup = new Guid(GuidCodeMaidContextSolutionFolderGroupString); - public static Guid GuidCodeMaidContextProjectNodeGroup = new Guid(GuidCodeMaidContextProjectNodeGroupString); - public static Guid GuidCodeMaidContextFolderNodeGroup = new Guid(GuidCodeMaidContextFolderNodeGroupString); - public static Guid GuidCodeMaidContextItemNodeGroup = new Guid(GuidCodeMaidContextItemNodeGroupString); - public static Guid GuidCodeMaidContextCrossProjectSolutionProjectGroup = new Guid(GuidCodeMaidContextCrossProjectSolutionProjectGroupString); - public static Guid GuidCodeMaidContextCrossProjectSolutionItemGroup = new Guid(GuidCodeMaidContextCrossProjectSolutionItemGroupString); - public static Guid GuidCodeMaidContextCrossProjectProjectItemGroup = new Guid(GuidCodeMaidContextCrossProjectProjectItemGroupString); - public static Guid GuidCodeMaidContextCrossProjectMultiProjectGroup = new Guid(GuidCodeMaidContextCrossProjectMultiProjectGroupString); - public static Guid GuidCodeMaidContextCrossProjectMultiItemGroup = new Guid(GuidCodeMaidContextCrossProjectMultiItemGroupString); - public static Guid GuidCodeMaidContextCrossProjectMultiSolutionFolderGroup = new Guid(GuidCodeMaidContextCrossProjectMultiSolutionFolderGroupString); - public static Guid GuidCodeMaidContextCrossProjectMultiProjectFolderGroup = new Guid(GuidCodeMaidContextCrossProjectMultiProjectFolderGroupString); - public static Guid GuidCodeMaidContextDocumentTabGroup = new Guid(GuidCodeMaidContextDocumentTabGroupString); - public static Guid GuidCodeMaidContextASPXWindowGroup = new Guid(GuidCodeMaidContextASPXWindowGroupString); - public static Guid GuidCodeMaidContextASPXCodeWindowGroup = new Guid(GuidCodeMaidContextASPXCodeWindowGroupString); - public static Guid GuidCodeMaidContextCodeWindowGroup = new Guid(GuidCodeMaidContextCodeWindowGroupString); - public static Guid GuidCodeMaidContextCSSWindowGroup = new Guid(GuidCodeMaidContextCSSWindowGroupString); - public static Guid GuidCodeMaidContextCSSDocumentGroup = new Guid(GuidCodeMaidContextCSSDocumentGroupString); - public static Guid GuidCodeMaidContextHTMLWindowGroup = new Guid(GuidCodeMaidContextHTMLWindowGroupString); - public static Guid GuidCodeMaidContextHTMLDocumentGroup = new Guid(GuidCodeMaidContextHTMLDocumentGroupString); - public static Guid GuidCodeMaidContextJSONDocumentGroup = new Guid(GuidCodeMaidContextJSONDocumentGroupString); - public static Guid GuidCodeMaidContextScriptWindowGroup = new Guid(GuidCodeMaidContextScriptWindowGroupString); - public static Guid GuidCodeMaidContextXAMLWindowGroup = new Guid(GuidCodeMaidContextXAMLWindowGroupString); - public static Guid GuidCodeMaidContextASPXWindowMenu = new Guid(GuidCodeMaidContextASPXWindowMenuString); - public static Guid GuidCodeMaidContextASPXCodeWindowMenu = new Guid(GuidCodeMaidContextASPXCodeWindowMenuString); - public static Guid GuidCodeMaidContextCodeWindowMenu = new Guid(GuidCodeMaidContextCodeWindowMenuString); - public static Guid GuidCodeMaidContextCSSWindowMenu = new Guid(GuidCodeMaidContextCSSWindowMenuString); - public static Guid GuidCodeMaidContextCSSDocumentMenu = new Guid(GuidCodeMaidContextCSSDocumentMenuString); - public static Guid GuidCodeMaidContextHTMLWindowMenu = new Guid(GuidCodeMaidContextHTMLWindowMenuString); - public static Guid GuidCodeMaidContextHTMLDocumentMenu = new Guid(GuidCodeMaidContextHTMLDocumentMenuString); - public static Guid GuidCodeMaidContextJSONDocumentMenu = new Guid(GuidCodeMaidContextJSONDocumentMenuString); - public static Guid GuidCodeMaidContextScriptWindowMenu = new Guid(GuidCodeMaidContextScriptWindowMenuString); - public static Guid GuidCodeMaidContextXAMLWindowMenu = new Guid(GuidCodeMaidContextXAMLWindowMenuString); - public static Guid GuidCodeMaidContextASPXWindowSubGroup = new Guid(GuidCodeMaidContextASPXWindowSubGroupString); - public static Guid GuidCodeMaidContextASPXCodeWindowSubGroup = new Guid(GuidCodeMaidContextASPXCodeWindowSubGroupString); - public static Guid GuidCodeMaidContextCodeWindowSubGroup = new Guid(GuidCodeMaidContextCodeWindowSubGroupString); - public static Guid GuidCodeMaidContextCSSWindowSubGroup = new Guid(GuidCodeMaidContextCSSWindowSubGroupString); - public static Guid GuidCodeMaidContextCSSDocumentSubGroup = new Guid(GuidCodeMaidContextCSSDocumentSubGroupString); - public static Guid GuidCodeMaidContextHTMLWindowSubGroup = new Guid(GuidCodeMaidContextHTMLWindowSubGroupString); - public static Guid GuidCodeMaidContextHTMLDocumentSubGroup = new Guid(GuidCodeMaidContextHTMLDocumentSubGroupString); - public static Guid GuidCodeMaidContextJSONDocumentSubGroup = new Guid(GuidCodeMaidContextJSONDocumentSubGroupString); - public static Guid GuidCodeMaidContextScriptWindowSubGroup = new Guid(GuidCodeMaidContextScriptWindowSubGroupString); - public static Guid GuidCodeMaidContextXAMLWindowSubGroup = new Guid(GuidCodeMaidContextXAMLWindowSubGroupString); - public static Guid GuidCodeMaidCommandAbout = new Guid(GuidCodeMaidCommandAboutString); - public static Guid GuidCodeMaidCommandBuildProgressToolWindow = new Guid(GuidCodeMaidCommandBuildProgressToolWindowString); - public static Guid GuidCodeMaidCommandCleanupActiveCode = new Guid(GuidCodeMaidCommandCleanupActiveCodeString); - public static Guid GuidCodeMaidCommandCleanupAllCode = new Guid(GuidCodeMaidCommandCleanupAllCodeString); - public static Guid GuidCodeMaidCommandCleanupOpenCode = new Guid(GuidCodeMaidCommandCleanupOpenCodeString); - public static Guid GuidCodeMaidCommandCleanupSelectedCode = new Guid(GuidCodeMaidCommandCleanupSelectedCodeString); - public static Guid GuidCodeMaidCommandCloseAllReadOnly = new Guid(GuidCodeMaidCommandCloseAllReadOnlyString); - public static Guid GuidCodeMaidCommandCollapseAllSolutionExplorer = new Guid(GuidCodeMaidCommandCollapseAllSolutionExplorerString); - public static Guid GuidCodeMaidCommandCollapseSelectedSolutionExplorer = new Guid(GuidCodeMaidCommandCollapseSelectedSolutionExplorerString); - public static Guid GuidCodeMaidCommandCommentFormat = new Guid(GuidCodeMaidCommandCommentFormatString); - public static Guid GuidCodeMaidCommandFindInSolutionExplorer = new Guid(GuidCodeMaidCommandFindInSolutionExplorerString); - public static Guid GuidCodeMaidCommandJoinLines = new Guid(GuidCodeMaidCommandJoinLinesString); - public static Guid GuidCodeMaidCommandOptions = new Guid(GuidCodeMaidCommandOptionsString); - public static Guid GuidCodeMaidCommandReadOnlyToggle = new Guid(GuidCodeMaidCommandReadOnlyToggleString); - public static Guid GuidCodeMaidCommandRemoveRegion = new Guid(GuidCodeMaidCommandRemoveRegionString); - public static Guid GuidCodeMaidCommandReorganizeActiveCode = new Guid(GuidCodeMaidCommandReorganizeActiveCodeString); - public static Guid GuidCodeMaidCommandSettingCleanupOnSave = new Guid(GuidCodeMaidCommandSettingCleanupOnSaveString); - public static Guid GuidCodeMaidCommandSortLines = new Guid(GuidCodeMaidCommandSortLinesString); - public static Guid GuidCodeMaidCommandSpadeContextDelete = new Guid(GuidCodeMaidCommandSpadeContextDeleteString); - public static Guid GuidCodeMaidCommandSpadeContextFindReferences = new Guid(GuidCodeMaidCommandSpadeContextFindReferencesString); - public static Guid GuidCodeMaidCommandSpadeContextInsertRegion = new Guid(GuidCodeMaidCommandSpadeContextInsertRegionString); - public static Guid GuidCodeMaidCommandSpadeContextRemoveRegion = new Guid(GuidCodeMaidCommandSpadeContextRemoveRegionString); - public static Guid GuidCodeMaidCommandSpadeOptions = new Guid(GuidCodeMaidCommandSpadeOptionsString); - public static Guid GuidCodeMaidCommandSpadeRefresh = new Guid(GuidCodeMaidCommandSpadeRefreshString); - public static Guid GuidCodeMaidCommandSpadeSearch = new Guid(GuidCodeMaidCommandSpadeSearchString); - public static Guid GuidCodeMaidCommandSpadeSortOrderAlpha = new Guid(GuidCodeMaidCommandSpadeSortOrderAlphaString); - public static Guid GuidCodeMaidCommandSpadeSortOrderFile = new Guid(GuidCodeMaidCommandSpadeSortOrderFileString); - public static Guid GuidCodeMaidCommandSpadeSortOrderType = new Guid(GuidCodeMaidCommandSpadeSortOrderTypeString); - public static Guid GuidCodeMaidCommandSpadeToolWindow = new Guid(GuidCodeMaidCommandSpadeToolWindowString); - public static Guid GuidCodeMaidCommandSwitchFile = new Guid(GuidCodeMaidCommandSwitchFileString); + public static Guid GuidCodeMaidMenuSet = new Guid(GuidCodeMaidMenuSetString); public static Guid GuidImageCleanup = new Guid(GuidImageCleanupString); public static Guid GuidImageCleanupAll = new Guid(GuidImageCleanupAllString); public static Guid GuidImageCloseLocked = new Guid(GuidImageCloseLockedString); diff --git a/CodeMaid/CodeMaid.csproj b/CodeMaid/CodeMaid.csproj index 5fbf19fa..b0374fd7 100644 --- a/CodeMaid/CodeMaid.csproj +++ b/CodeMaid/CodeMaid.csproj @@ -1,9 +1,10 @@  - + Debug AnyCPU + true 2.0 {19B1AB9E-4603-4A9C-9284-32AAE57FB7BC} {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} @@ -15,27 +16,11 @@ ..\CodeMaid.snk v4.6.1 15.0 - 12.0 - - - - - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - + en-US + Program + $(DevEnvDir)devenv.exe + /rootsuffix Exp + latest true @@ -189,6 +174,7 @@ + @@ -197,6 +183,7 @@ + @@ -204,6 +191,8 @@ + + @@ -254,7 +243,6 @@ - @@ -304,6 +292,11 @@ + + True + True + Resources.resx + True True @@ -350,6 +343,7 @@ + @@ -392,23 +386,21 @@ + + RadialProgressBar.xaml + SpadeView.xaml + - - 1000 - Designer - VsctGenerator - CodeMaid.cs - @@ -416,6 +408,10 @@ + + true + Always + source.extension.vsixmanifest @@ -591,6 +587,20 @@ Always true + + Menus.ctmenu + CodeMaid.vsct + + + Menus.ctmenu + CodeMaid.vsct + Designer + + + Designer + CodeMaid.cs + VsctGenerator + Always true @@ -677,6 +687,10 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer @@ -765,35 +779,45 @@ MSBuild:Compile Designer + + MSBuild:Compile + Designer + MSBuild:Compile Designer - - False - Microsoft .NET Framework 4.5 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - + + Resources.resx + + + PublicResXFileCodeGenerator + Resources.Designer.cs + Designer + + + Resources.resx + + + true + VSPackage.en-US.resources + source.extension.vsixmanifest + + True True source.extension.vsixmanifest true VSPackage + + + true + VSPackage.zh-Hans.resources + source.extension.vsixmanifest - - true - 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/CodeMaid/CodeMaid.csproj.user b/CodeMaid/CodeMaid.csproj.user deleted file mode 100644 index f8b1055c..00000000 --- a/CodeMaid/CodeMaid.csproj.user +++ /dev/null @@ -1,24 +0,0 @@ - - - - Program - C:\Program Files %28x86%29\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe - /rootsuffix Exp - - - - - - - - - en-US - false - ProjectFiles - - - Program - C:\Program Files %28x86%29\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe - /rootsuffix Exp - - \ No newline at end of file diff --git a/CodeMaid/CodeMaid.en-US.vsct b/CodeMaid/CodeMaid.en-US.vsct new file mode 100644 index 00000000..c820c384 --- /dev/null +++ b/CodeMaid/CodeMaid.en-US.vsct @@ -0,0 +1,363 @@ + + + + + + + + + + + + + + + &CodeMaid + &CodeMaid + + + + DefaultDocked + + CodeMaid Spade Toolbar + CodeMaid Spade Toolbar + + + + + CodeMaid Spade Context Menu + CodeMaid Spade Context Menu + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CodeMaid/CodeMaid.vsct b/CodeMaid/CodeMaid.vsct index cb4be8a7..4d6a1f10 100644 --- a/CodeMaid/CodeMaid.vsct +++ b/CodeMaid/CodeMaid.vsct @@ -34,503 +34,163 @@ group; your package should define its own command set in order to avoid collisions with command ids defined by other packages. --> - - - - - - &CodeMaid - &CodeMaid - - - - DefaultDocked - - CodeMaid Spade Toolbar - CodeMaid Spade Toolbar - - - - - CodeMaid Spade Context Menu - CodeMaid Spade Context Menu - - - - - - CodeMaid - - - - - - CodeMaid - - - - - - CodeMaid - - - - - - CodeMaid - - - - - - CodeMaid - - - - - - CodeMaid - - - - - - CodeMaid - - - - - - CodeMaid - - - - - - CodeMaid - - - - - - CodeMaid - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + - - + + + - - - + - - - - - - - - - - - - - - - - - - + - - - + - - - - - - - - - + - - - + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/CodeMaid/CodeMaid.zh-Hans.vsct b/CodeMaid/CodeMaid.zh-Hans.vsct new file mode 100644 index 00000000..5f85c3db --- /dev/null +++ b/CodeMaid/CodeMaid.zh-Hans.vsct @@ -0,0 +1,363 @@ + + + + + + + + + + + + + + + &CodeMaid + &CodeMaid + + + + DefaultDocked + + CodeMaid Spade Toolbar + CodeMaid码锹窗口 + + + + + CodeMaid Spade Context Menu + CodeMaid Spade Context Menu + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + CodeMaid + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CodeMaid/CodeMaidPackage.cs b/CodeMaid/CodeMaidPackage.cs index 72881ab4..9217d7c8 100644 --- a/CodeMaid/CodeMaidPackage.cs +++ b/CodeMaid/CodeMaidPackage.cs @@ -13,15 +13,14 @@ using SteveCadwallader.CodeMaid.UI.ToolWindows.BuildProgress; using SteveCadwallader.CodeMaid.UI.ToolWindows.Spade; using System; -using System.Collections.Generic; using System.ComponentModel.Design; using System.Diagnostics; using System.Globalization; using System.IO; -using System.Linq; using System.Runtime.InteropServices; using System.Windows; using System.Windows.Threading; +using VSColorTheme = Microsoft.VisualStudio.PlatformUI.VSColorTheme; namespace SteveCadwallader.CodeMaid { @@ -37,12 +36,11 @@ namespace SteveCadwallader.CodeMaid /// [PackageRegistration(UseManagedResourcesOnly = true)] // Tells Visual Studio utilities that this is a package that needs registered. [InstalledProductRegistration("#110", "#112", Vsix.Version, IconResourceID = 400, LanguageIndependentName = "CodeMaid")] // VS Help/About details (Name, Description, Version, Icon). - [ProvideAutoLoad("ADFC4E64-0397-11D1-9F4E-00A0C911004F")] // Force CodeMaid to load on startup so menu items can determine their state. + [ProvideAutoLoad(VSConstants.UICONTEXT.SolutionExistsAndFullyLoaded_string)] // Force CodeMaid to load so menu items can determine their state. [ProvideBindingPath] - [ProvideMenuResource(1000, 1)] // This attribute is needed to let the shell know that this package exposes some menus. + [ProvideMenuResource("Menus.ctmenu", 1)] // This attribute is needed to let the shell know that this package exposes some menus. [ProvideToolWindow(typeof(BuildProgressToolWindow), MultiInstances = false, Height = 40, Width = 500, Style = VsDockStyle.Tabbed, Orientation = ToolWindowOrientation.Bottom, Window = EnvDTE.Constants.vsWindowKindMainWindow)] [ProvideToolWindow(typeof(SpadeToolWindow), MultiInstances = false, Style = VsDockStyle.Tabbed, Orientation = ToolWindowOrientation.Left, Window = EnvDTE.Constants.vsWindowKindSolutionExplorer)] - [ProvideToolWindowVisibility(typeof(SpadeToolWindow), "{F1536EF8-92EC-443C-9ED7-FDADF150DA82}")] [Guid(PackageGuids.GuidCodeMaidPackageString)] // Package unique GUID. public sealed class CodeMaidPackage : Package, IVsInstalledProduct { @@ -53,11 +51,6 @@ public sealed class CodeMaidPackage : Package, IVsInstalledProduct /// private BuildProgressToolWindow _buildProgress; - /// - /// An internal collection of the commands registered by this package. - /// - private readonly ICollection _commands = new List(); - /// /// The IComponentModel service. /// @@ -68,11 +61,6 @@ public sealed class CodeMaidPackage : Package, IVsInstalledProduct /// private DTE2 _ide; - /// - /// The service provider. - /// - private IServiceProvider _serviceProvider; - /// /// The Spade tool window. /// @@ -108,6 +96,8 @@ public CodeMaidPackage() Settings.Default.Upgrade(); Settings.Default.Save(); } + + SettingsMonitor = new SettingsMonitor(Settings.Default); } #endregion Constructors @@ -134,9 +124,15 @@ public Document ActiveDocument } /// - /// Gets the build progress tool window, creating it if necessary. + /// Gets the build progress tool window, if it already exists. /// public BuildProgressToolWindow BuildProgress => + _buildProgress ?? (_buildProgress = (FindToolWindow(typeof(BuildProgressToolWindow), 0, false) as BuildProgressToolWindow)); + + /// + /// Gets the build progress tool window, creating it if necessary. + /// + public BuildProgressToolWindow BuildProgressForceLoad => _buildProgress ?? (_buildProgress = (FindToolWindow(typeof(BuildProgressToolWindow), 0, true) as BuildProgressToolWindow)); /// @@ -166,12 +162,7 @@ public Document ActiveDocument public OleMenuCommandService MenuCommandService => GetService(typeof(IMenuCommandService)) as OleMenuCommandService; /// - /// Gets the service provider. - /// - public IServiceProvider ServiceProvider => _serviceProvider ?? (_serviceProvider = new ServiceProvider((Microsoft.VisualStudio.OLE.Interop.IServiceProvider)IDE)); - - /// - /// Gets the Spade tool window, iff it already exists. + /// Gets the Spade tool window, if it already exists. /// public SpadeToolWindow Spade => _spade ?? (_spade = (FindToolWindow(typeof(SpadeToolWindow), 0, false) as SpadeToolWindow)); @@ -187,55 +178,9 @@ public Document ActiveDocument /// public ThemeManager ThemeManager => _themeManager ?? (_themeManager = ThemeManager.GetInstance(this)); - #endregion Public Integration Properties - - #region Private Event Listener Properties - - /// - /// Gets or sets the build progress event listener. - /// - private BuildProgressEventListener BuildProgressEventListener { get; set; } - - /// - /// Gets or sets the document event listener. - /// - private DocumentEventListener DocumentEventListener { get; set; } - - /// - /// Gets or sets the running document table event listener. - /// - private RunningDocumentTableEventListener RunningDocumentTableEventListener { get; set; } - - /// - /// Gets or sets the shell event listener. - /// - private ShellEventListener ShellEventListener { get; set; } - - /// - /// Gets or sets the solution event listener. - /// - private SolutionEventListener SolutionEventListener { get; set; } - - /// - /// Gets or sets the text editor event listener. - /// - private TextEditorEventListener TextEditorEventListener { get; set; } - - /// - /// Gets or sets the window event listener. - /// - private WindowEventListener WindowEventListener { get; set; } - - #endregion Private Event Listener Properties - - #region Private Service Properties + public SettingsMonitor SettingsMonitor { get; } - /// - /// Gets the shell service. - /// - private IVsShell ShellService => GetService(typeof(SVsShell)) as IVsShell; - - #endregion Private Service Properties + #endregion Public Integration Properties #region Package Members @@ -250,7 +195,7 @@ protected override void Initialize() base.Initialize(); RegisterCommands(); - RegisterShellEventListener(); + RegisterEventListeners(); } #endregion Package Members @@ -339,114 +284,99 @@ private void OnSolutionClosedShowStartPage() /// private void RegisterCommands() { - var menuCommandService = MenuCommandService; - if (menuCommandService != null) - { - // Create the individual commands, which internally register for command events. - _commands.Add(new AboutCommand(this)); - _commands.Add(new BuildProgressToolWindowCommand(this)); - _commands.Add(new CleanupActiveCodeCommand(this)); - _commands.Add(new CleanupAllCodeCommand(this)); - _commands.Add(new CleanupOpenCodeCommand(this)); - _commands.Add(new CleanupSelectedCodeCommand(this)); - _commands.Add(new CloseAllReadOnlyCommand(this)); - _commands.Add(new CollapseAllSolutionExplorerCommand(this)); - _commands.Add(new CollapseSelectedSolutionExplorerCommand(this)); - _commands.Add(new CommentFormatCommand(this)); - _commands.Add(new FindInSolutionExplorerCommand(this)); - _commands.Add(new JoinLinesCommand(this)); - _commands.Add(new OptionsCommand(this)); - _commands.Add(new ReadOnlyToggleCommand(this)); - _commands.Add(new RemoveRegionCommand(this)); - _commands.Add(new ReorganizeActiveCodeCommand(this)); - _commands.Add(new SettingCleanupOnSaveCommand(this)); - _commands.Add(new SortLinesCommand(this)); - _commands.Add(new SpadeContextDeleteCommand(this)); - _commands.Add(new SpadeContextFindReferencesCommand(this)); - _commands.Add(new SpadeContextInsertRegionCommand(this)); - _commands.Add(new SpadeContextRemoveRegionCommand(this)); - _commands.Add(new SpadeOptionsCommand(this)); - _commands.Add(new SpadeRefreshCommand(this)); - _commands.Add(new SpadeSearchCommand(this)); - _commands.Add(new SpadeSortOrderAlphaCommand(this)); - _commands.Add(new SpadeSortOrderFileCommand(this)); - _commands.Add(new SpadeSortOrderTypeCommand(this)); - _commands.Add(new SpadeToolWindowCommand(this)); - _commands.Add(new SwitchFileCommand(this)); - - // Add all commands to the menu command service. - foreach (var command in _commands) - { - menuCommandService.AddCommand(command); - } - } - } - - /// - /// Registers the shell event listener. - /// - /// - /// This event listener is registered by itself and first to wait for the shell to be ready - /// for other event listeners to be registered. - /// - private void RegisterShellEventListener() - { - ShellEventListener = new ShellEventListener(this, ShellService); - ShellEventListener.EnvironmentColorChanged += () => ThemeManager.ApplyTheme(); - ShellEventListener.ShellAvailable += RegisterNonShellEventListeners; + // Initialize the individual commands, which internally register for command events. + AboutCommand.Initialize(this); + BuildProgressToolWindowCommand.Initialize(this); + CleanupActiveCodeCommand.Initialize(this); + CleanupAllCodeCommand.Initialize(this); + CleanupOpenCodeCommand.Initialize(this); + CleanupSelectedCodeCommand.Initialize(this); + CloseAllReadOnlyCommand.Initialize(this); + CollapseAllSolutionExplorerCommand.Initialize(this); + CollapseSelectedSolutionExplorerCommand.Initialize(this); + CommentFormatCommand.Initialize(this); + FindInSolutionExplorerCommand.Initialize(this); + JoinLinesCommand.Initialize(this); + OptionsCommand.Initialize(this); + ReadOnlyToggleCommand.Initialize(this); + RemoveRegionCommand.Initialize(this); + ReorganizeActiveCodeCommand.Initialize(this); + SettingCleanupOnSaveCommand.Initialize(this); + SortLinesCommand.Initialize(this); + SpadeContextDeleteCommand.Initialize(this); + SpadeContextFindReferencesCommand.Initialize(this); + SpadeContextInsertRegionCommand.Initialize(this); + SpadeContextRemoveRegionCommand.Initialize(this); + SpadeOptionsCommand.Initialize(this); + SpadeRefreshCommand.Initialize(this); + SpadeSearchCommand.Initialize(this); + SpadeSortOrderAlphaCommand.Initialize(this); + SpadeSortOrderFileCommand.Initialize(this); + SpadeSortOrderTypeCommand.Initialize(this); + SpadeToolWindowCommand.Initialize(this); + SwitchFileCommand.Initialize(this); } /// /// Register the package event listeners. /// /// - /// This must occur after the DTE service is available since many of the events are based - /// off of the DTE object. + /// Every event listener registers VS events by itself. /// - private void RegisterNonShellEventListeners() + private void RegisterEventListeners() { - // Create event listeners and register for events. - var menuCommandService = MenuCommandService; - if (menuCommandService != null) - { - var buildProgressToolWindowCommand = _commands.OfType().First(); - var cleanupActiveCodeCommand = _commands.OfType().First(); - var collapseAllSolutionExplorerCommand = _commands.OfType().First(); - var spadeToolWindowCommand = _commands.OfType().First(); - - var codeModelManager = CodeModelManager.GetInstance(this); - var settingsContextHelper = SettingsContextHelper.GetInstance(this); - - BuildProgressEventListener = new BuildProgressEventListener(this); - BuildProgressEventListener.BuildBegin += buildProgressToolWindowCommand.OnBuildBegin; - BuildProgressEventListener.BuildProjConfigBegin += buildProgressToolWindowCommand.OnBuildProjConfigBegin; - BuildProgressEventListener.BuildProjConfigDone += buildProgressToolWindowCommand.OnBuildProjConfigDone; - BuildProgressEventListener.BuildDone += buildProgressToolWindowCommand.OnBuildDone; - - DocumentEventListener = new DocumentEventListener(this); - DocumentEventListener.OnDocumentClosing += codeModelManager.OnDocumentClosing; - - RunningDocumentTableEventListener = new RunningDocumentTableEventListener(this); - RunningDocumentTableEventListener.BeforeSave += cleanupActiveCodeCommand.OnBeforeDocumentSave; - RunningDocumentTableEventListener.AfterSave += spadeToolWindowCommand.OnAfterDocumentSave; - - SolutionEventListener = new SolutionEventListener(this); - SolutionEventListener.OnSolutionOpened += collapseAllSolutionExplorerCommand.OnSolutionOpened; - SolutionEventListener.OnSolutionOpened += settingsContextHelper.OnSolutionOpened; - SolutionEventListener.OnSolutionClosed += settingsContextHelper.OnSolutionClosed; - SolutionEventListener.OnSolutionClosed += OnSolutionClosedShowStartPage; - - // Check if a solution has already been opened before CodeMaid was initialized. - if (IDE.Solution != null && IDE.Solution.IsOpen) - { - collapseAllSolutionExplorerCommand.OnSolutionOpened(); - } + var codeModelManager = CodeModelManager.GetInstance(this); + var settingsContextHelper = SettingsContextHelper.GetInstance(this); + + VSColorTheme.ThemeChanged += _ => ThemeManager.ApplyTheme(); + + BuildProgressEventListener.Intialize(this); + BuildProgressEventListener.Instance.BuildBegin += BuildProgressToolWindowCommand.Instance.OnBuildBegin; + BuildProgressEventListener.Instance.BuildProjConfigBegin += BuildProgressToolWindowCommand.Instance.OnBuildProjConfigBegin; + BuildProgressEventListener.Instance.BuildProjConfigDone += BuildProgressToolWindowCommand.Instance.OnBuildProjConfigDone; + BuildProgressEventListener.Instance.BuildDone += BuildProgressToolWindowCommand.Instance.OnBuildDone; - TextEditorEventListener = new TextEditorEventListener(this); - TextEditorEventListener.OnLineChanged += codeModelManager.OnDocumentChanged; + DocumentEventListener.Intialize(this); + DocumentEventListener.Instance.OnDocumentClosing += codeModelManager.OnDocumentClosing; - WindowEventListener = new WindowEventListener(this); - WindowEventListener.OnWindowChange += spadeToolWindowCommand.OnWindowChange; + RunningDocumentTableEventListener.Intialize(this); + SettingsMonitor.Watch(s => s.Feature_SettingCleanupOnSave, on => + { + if (on) + RunningDocumentTableEventListener.Instance.BeforeSave += CleanupActiveCodeCommand.Instance.OnBeforeDocumentSave; + else + RunningDocumentTableEventListener.Instance.BeforeSave -= CleanupActiveCodeCommand.Instance.OnBeforeDocumentSave; + }); + SettingsMonitor.Watch(s => s.Feature_SpadeToolWindow, on => + { + if (on) + RunningDocumentTableEventListener.Instance.AfterSave += SpadeToolWindowCommand.Instance.OnAfterDocumentSave; + else + RunningDocumentTableEventListener.Instance.AfterSave -= SpadeToolWindowCommand.Instance.OnAfterDocumentSave; + }); + + SolutionEventListener.Intialize(this); + SettingsMonitor.Watch(s => s.Feature_CollapseAllSolutionExplorer, on => + { + if (on) + SolutionEventListener.Instance.OnSolutionOpened += CollapseAllSolutionExplorerCommand.Instance.OnSolutionOpened; + else + SolutionEventListener.Instance.OnSolutionOpened -= CollapseAllSolutionExplorerCommand.Instance.OnSolutionOpened; + }); + SolutionEventListener.Instance.OnSolutionOpened += settingsContextHelper.OnSolutionOpened; + SolutionEventListener.Instance.OnSolutionClosed += settingsContextHelper.OnSolutionClosed; + SolutionEventListener.Instance.OnSolutionClosed += OnSolutionClosedShowStartPage; + + TextEditorEventListener.Intialize(this); + TextEditorEventListener.Instance.OnLineChanged += codeModelManager.OnDocumentChanged; + + WindowEventListener.Intialize(this); + WindowEventListener.Instance.OnWindowChange += SpadeToolWindowCommand.Instance.OnWindowChange; + + // Check if a solution has already been opened before CodeMaid was initialized. + if (IDE.Solution != null && IDE.Solution.IsOpen) + { + SolutionEventListener.Instance.FireSolutionOpenedEvent(); } } @@ -466,13 +396,12 @@ protected override void Dispose(bool disposing) base.Dispose(disposing); // Dispose of any event listeners. - BuildProgressEventListener?.Dispose(); - DocumentEventListener?.Dispose(); - RunningDocumentTableEventListener?.Dispose(); - ShellEventListener?.Dispose(); - SolutionEventListener?.Dispose(); - TextEditorEventListener?.Dispose(); - WindowEventListener?.Dispose(); + BuildProgressEventListener.Instance.Dispose(); + DocumentEventListener.Instance.Dispose(); + RunningDocumentTableEventListener.Instance.Dispose(); + SolutionEventListener.Instance.Dispose(); + TextEditorEventListener.Instance.Dispose(); + WindowEventListener.Instance.Dispose(); } #endregion IDisposable Members diff --git a/CodeMaid/Helpers/CodeCommentHelper.cs b/CodeMaid/Helpers/CodeCommentHelper.cs index d65e0018..3587d434 100644 --- a/CodeMaid/Helpers/CodeCommentHelper.cs +++ b/CodeMaid/Helpers/CodeCommentHelper.cs @@ -1,7 +1,9 @@ using EnvDTE; using SteveCadwallader.CodeMaid.Properties; using System; +using System.Collections.Generic; using System.Diagnostics; +using System.Linq; using System.Text.RegularExpressions; namespace SteveCadwallader.CodeMaid.Helpers @@ -140,7 +142,7 @@ internal static Regex GetCommentRegex(CodeLanguage codeLanguage, bool includePre prefix = string.Format(@"(?[\t ]*{0})(?( |\t|\r|\n|$))?", prefix); } - var pattern = string.Format(@"^{0}(?(?[\t ]*)(?[-=\*\+]+[ \t]*|\w+[\):][ \t]+|\d+\.[ \t]+)?((?[^\t\r\n ]+)*[\t ]*)*)[\r]*[\n]?$", prefix); + var pattern = string.Format(@"^{0}(?[\t ]*)(?(?[-=\*\+]+[ \t]*|\w+[\):][ \t]+|\d+\.[ \t]+)?((?[^\t\r\n ]+)*[\t ]*)*)\r*\n?$", prefix); return new Regex(pattern, RegexOptions.ExplicitCapture | RegexOptions.Multiline); } @@ -161,6 +163,23 @@ internal static int GetTabSize(CodeMaidPackage package, TextDocument document) } } + /// + /// Gets the list of tokens defined in Tools > Options > Environment > Task List. + /// + /// + /// + public static IEnumerable GetTaskListTokens(CodeMaidPackage package) + { + var settings = package.IDE.Properties["Environment", "TaskList"]; + var tokens = settings.Item("CommentTokens").Value as string[]; + if (tokens == null || tokens.Length < 1) + return Enumerable.Empty(); + + // Tokens values are written like "NAME:PRIORITY". We want only the names, and require + // that they are followed by a semicolon and a space. + return tokens.Select(t => t.Substring(0, t.LastIndexOf(':') + 1) + " "); + } + internal static bool IsCommentLine(EditPoint point) { return LineMatchesRegex(point, GetCommentRegex(point.GetCodeLanguage())).Success; diff --git a/CodeMaid/Helpers/CodeItemTypeComparer.cs b/CodeMaid/Helpers/CodeItemTypeComparer.cs index 67681d17..7a319193 100644 --- a/CodeMaid/Helpers/CodeItemTypeComparer.cs +++ b/CodeMaid/Helpers/CodeItemTypeComparer.cs @@ -2,7 +2,6 @@ using SteveCadwallader.CodeMaid.Model.CodeItems; using SteveCadwallader.CodeMaid.Properties; using System.Collections.Generic; -using System.Linq; namespace SteveCadwallader.CodeMaid.Helpers { diff --git a/CodeMaid/Helpers/CommandHelper.cs b/CodeMaid/Helpers/CommandHelper.cs index 9127735b..962064e7 100644 --- a/CodeMaid/Helpers/CommandHelper.cs +++ b/CodeMaid/Helpers/CommandHelper.cs @@ -1,5 +1,5 @@ -using System; -using EnvDTE; +using EnvDTE; +using System; using System.Linq; namespace SteveCadwallader.CodeMaid.Helpers diff --git a/CodeMaid/Helpers/OutputWindowHelper.cs b/CodeMaid/Helpers/OutputWindowHelper.cs index d4c8668d..0505183a 100644 --- a/CodeMaid/Helpers/OutputWindowHelper.cs +++ b/CodeMaid/Helpers/OutputWindowHelper.cs @@ -39,7 +39,7 @@ internal static void DiagnosticWriteLine(string message, Exception ex = null) message += $": {ex}"; } - WriteLine("Diagnostic", message); + WriteLine(Resources.Diagnostic, message); } /// @@ -51,7 +51,7 @@ internal static void ExceptionWriteLine(string message, Exception ex) { var exceptionMessage = $"{message}: {ex}"; - WriteLine("Handled Exception", exceptionMessage); + WriteLine(Resources.HandledException, exceptionMessage); } /// @@ -60,7 +60,7 @@ internal static void ExceptionWriteLine(string message, Exception ex) /// The message. internal static void WarningWriteLine(string message) { - WriteLine("Warning", message); + WriteLine(Resources.Warning, message); } /// diff --git a/CodeMaid/Helpers/SettingsContextHelper.cs b/CodeMaid/Helpers/SettingsContextHelper.cs index 5180fa43..d8e82306 100644 --- a/CodeMaid/Helpers/SettingsContextHelper.cs +++ b/CodeMaid/Helpers/SettingsContextHelper.cs @@ -82,7 +82,10 @@ internal static string GetSolutionSettingsPath(SettingsContext context) /// internal void OnSolutionOpened() { - LoadSolutionSpecificSettings(Settings.Default); + if (LoadSolutionSpecificSettings(Settings.Default)) + { + _package.SettingsMonitor.NotifySettingsChanged(); + } } /// @@ -90,7 +93,10 @@ internal void OnSolutionOpened() /// internal void OnSolutionClosed() { - UnloadSolutionSpecificSettings(Settings.Default); + if (UnloadSolutionSpecificSettings(Settings.Default)) + { + _package.SettingsMonitor.NotifySettingsChanged(); + } } /// diff --git a/CodeMaid/Helpers/SettingsMonitor.cs b/CodeMaid/Helpers/SettingsMonitor.cs new file mode 100644 index 00000000..d239e761 --- /dev/null +++ b/CodeMaid/Helpers/SettingsMonitor.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Linq.Expressions; + +namespace SteveCadwallader.CodeMaid.Helpers +{ + public sealed class SettingsMonitor + where TSetting : ApplicationSettingsBase + { + private readonly Dictionary _monitors = new Dictionary(new StringArrayComparer()); + private readonly TSetting _settings; + + public SettingsMonitor(TSetting settings) + { + _settings = settings; + _settings.SettingsSaving += (s, e) => NotifySettingsChanged(); + } + + internal void NotifySettingsChanged() + { + foreach (var item in _monitors) + { + var monitor = item.Value; + var oldValues = monitor.LastValues; + var newValues = FindValues(item.Key); + if (!Enumerable.SequenceEqual(oldValues, newValues)) + { + monitor.LastValues = newValues; + monitor.Callback.Invoke(newValues); + } + } + } + + private object[] FindValues(string[] settings) => Array.ConvertAll(settings, key => _settings[key]); + + public void Watch(Expression> setting, Action changedCallback) + { + var settingName = (setting.Body as MemberExpression).Member.Name; + Watch(new[] { settingName }, values => changedCallback.Invoke(values[0])); + } + + public void Watch(string[] settings, Action changedCallback) + { + Watch(settings, (object[] values) => + { + var typedValues = Array.ConvertAll(values, v => (TValue)v); + changedCallback.Invoke(typedValues); + }); + } + + public void Watch(string[] settings, Action changedCallback) + { + var values = FindValues(settings); + + changedCallback.Invoke(values); + + if (_monitors.TryGetValue(settings, out var monitor)) + { + monitor.Callback += changedCallback; + } + else + { + monitor = new Monitor { LastValues = values, Callback = changedCallback }; + _monitors.Add(settings, monitor); + } + } + + private class Monitor + { + public object[] LastValues; + public Action Callback; + } + + private class StringArrayComparer : IEqualityComparer + { + private static readonly StringComparer ElementComparer = StringComparer.OrdinalIgnoreCase; + + public bool Equals(string[] x, string[] y) + => Enumerable.SequenceEqual(x, y, ElementComparer); + + public int GetHashCode(string[] strings) + { + int hash = 0; + for (int i = 0; i < strings.Length; i++) + { + hash = unchecked( + hash * 31 ^ ElementComparer.GetHashCode(strings[i]) + ); + } + return hash; + } + } + } +} \ No newline at end of file diff --git a/CodeMaid/Helpers/UndoTransactionHelper.cs b/CodeMaid/Helpers/UndoTransactionHelper.cs index 1ed64fdf..53f44927 100644 --- a/CodeMaid/Helpers/UndoTransactionHelper.cs +++ b/CodeMaid/Helpers/UndoTransactionHelper.cs @@ -56,9 +56,9 @@ public void Run(Action tryAction, Action catchAction = null) } catch (Exception ex) { - var message = $"{_transactionName} was stopped"; + var message = $"{_transactionName}{Resources.WasStopped}"; OutputWindowHelper.ExceptionWriteLine(message, ex); - _package.IDE.StatusBar.Text = $"{message}. See output window for more details."; + _package.IDE.StatusBar.Text = $"{message}{Resources.SeeOutputWindowForMoreDetails}"; catchAction?.Invoke(ex); diff --git a/CodeMaid/Integration/Commands/AboutCommand.cs b/CodeMaid/Integration/Commands/AboutCommand.cs index aa2f7726..d9326954 100644 --- a/CodeMaid/Integration/Commands/AboutCommand.cs +++ b/CodeMaid/Integration/Commands/AboutCommand.cs @@ -1,13 +1,24 @@ using SteveCadwallader.CodeMaid.UI.Dialogs.About; -using System.ComponentModel.Design; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for launching the CodeMaid about window. /// - internal class AboutCommand : BaseCommand + internal sealed class AboutCommand : BaseCommand { + #region Singleton + + public static AboutCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new AboutCommand(package); + Instance.Switch(on: true); + } + + #endregion Singleton + #region Constructors /// @@ -15,8 +26,7 @@ internal class AboutCommand : BaseCommand /// /// The hosting package. internal AboutCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandAbout, PackageIds.CmdIDCodeMaidAbout)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidAbout) { } diff --git a/CodeMaid/Integration/Commands/BaseCommand.cs b/CodeMaid/Integration/Commands/BaseCommand.cs index 710b6fb9..aa504049 100644 --- a/CodeMaid/Integration/Commands/BaseCommand.cs +++ b/CodeMaid/Integration/Commands/BaseCommand.cs @@ -8,7 +8,7 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// /// The base implementation of a command. /// - internal abstract class BaseCommand : OleMenuCommand + internal abstract class BaseCommand : OleMenuCommand, ISwitchableFeature { #region Constructors @@ -16,13 +16,12 @@ internal abstract class BaseCommand : OleMenuCommand /// Initializes a new instance of the class. /// /// The hosting package. - /// The id for the command. - protected BaseCommand(CodeMaidPackage package, CommandID id) - : base(BaseCommand_Execute, id) + /// The GUID for the command ID. + /// The id for the command ID. + protected BaseCommand(CodeMaidPackage package, Guid menuGroup, int commandID) + : base(BaseCommand_Execute, null, BaseCommand_BeforeQueryStatus, new CommandID(menuGroup, commandID)) { Package = package; - - BeforeQueryStatus += BaseCommand_BeforeQueryStatus; } #endregion Constructors @@ -81,6 +80,18 @@ protected virtual void OnExecute() OutputWindowHelper.DiagnosticWriteLine($"{GetType().Name}.OnExecute invoked"); } + public virtual void Switch(bool on) + { + if (on && Package.MenuCommandService.FindCommand(CommandID) == null) + { + Package.MenuCommandService.AddCommand(this); + } + else if (!on) + { + Package.MenuCommandService.RemoveCommand(this); + } + } + #endregion Methods } } \ No newline at end of file diff --git a/CodeMaid/Integration/Commands/BuildProgressToolWindowCommand.cs b/CodeMaid/Integration/Commands/BuildProgressToolWindowCommand.cs index 143d79c8..afd6c099 100644 --- a/CodeMaid/Integration/Commands/BuildProgressToolWindowCommand.cs +++ b/CodeMaid/Integration/Commands/BuildProgressToolWindowCommand.cs @@ -1,15 +1,26 @@ using EnvDTE; using Microsoft.VisualStudio.Shell.Interop; using SteveCadwallader.CodeMaid.Properties; -using System.ComponentModel.Design; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for launching the build progress tool window. /// - internal class BuildProgressToolWindowCommand : BaseCommand + internal sealed class BuildProgressToolWindowCommand : BaseCommand { + #region Singleton + + public static BuildProgressToolWindowCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new BuildProgressToolWindowCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_BuildProgressToolWindow, Instance.Switch); + } + + #endregion Singleton + #region Constructors /// @@ -17,8 +28,7 @@ internal class BuildProgressToolWindowCommand : BaseCommand /// /// The hosting package. internal BuildProgressToolWindowCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandBuildProgressToolWindow, PackageIds.CmdIDCodeMaidBuildProgressToolWindow)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidBuildProgressToolWindow) { } @@ -33,7 +43,7 @@ private IVsWindowFrame BuildProgressWindowFrame { get { - var buildProgress = Package.BuildProgress; + var buildProgress = Package.BuildProgressForceLoad; if (buildProgress != null) { return buildProgress.Frame as IVsWindowFrame; @@ -57,6 +67,16 @@ protected override void OnExecute() ShowBuildProgressToolWindow(); } + public override void Switch(bool on) + { + base.Switch(on); + + if (!on) + { + Package.BuildProgress?.Close(); + } + } + #endregion BaseCommand Methods #region Internal Methods @@ -68,7 +88,7 @@ protected override void OnExecute() /// The action. internal void OnBuildBegin(vsBuildScope scope, vsBuildAction action) { - var buildProgress = Package.BuildProgress; + var buildProgress = Package.BuildProgressForceLoad; if (buildProgress != null) { buildProgress.NotifyBuildBegin(scope, action); @@ -89,7 +109,7 @@ internal void OnBuildBegin(vsBuildScope scope, vsBuildAction action) /// The solution config. internal void OnBuildProjConfigBegin(string project, string projectConfig, string platform, string solutionConfig) { - var buildProgress = Package.BuildProgress; + var buildProgress = Package.BuildProgressForceLoad; if (buildProgress != null) { buildProgress.NotifyBuildProjConfigBegin(project, projectConfig, platform, solutionConfig); @@ -106,7 +126,7 @@ internal void OnBuildProjConfigBegin(string project, string projectConfig, strin /// True if project build was successful, otherwise false. internal void OnBuildProjConfigDone(string project, string projectConfig, string platform, string solutionConfig, bool success) { - var buildProgress = Package.BuildProgress; + var buildProgress = Package.BuildProgressForceLoad; if (buildProgress != null) { buildProgress.NotifyBuildProjConfigDone(project, projectConfig, platform, solutionConfig, success); @@ -120,7 +140,7 @@ internal void OnBuildProjConfigDone(string project, string projectConfig, string /// The action. internal void OnBuildDone(vsBuildScope scope, vsBuildAction action) { - var buildProgress = Package.BuildProgress; + var buildProgress = Package.BuildProgressForceLoad; if (buildProgress != null) { buildProgress.NotifyBuildDone(scope, action); diff --git a/CodeMaid/Integration/Commands/CleanupActiveCodeCommand.cs b/CodeMaid/Integration/Commands/CleanupActiveCodeCommand.cs index 5e4c87d7..b7ec1802 100644 --- a/CodeMaid/Integration/Commands/CleanupActiveCodeCommand.cs +++ b/CodeMaid/Integration/Commands/CleanupActiveCodeCommand.cs @@ -2,15 +2,26 @@ using SteveCadwallader.CodeMaid.Helpers; using SteveCadwallader.CodeMaid.Logic.Cleaning; using SteveCadwallader.CodeMaid.Properties; -using System.ComponentModel.Design; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for cleaning up code in the active document. /// - internal class CleanupActiveCodeCommand : BaseCommand + internal sealed class CleanupActiveCodeCommand : BaseCommand { + #region Singleton + + public static CleanupActiveCodeCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new CleanupActiveCodeCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_CleanupActiveCode, Instance.Switch); + } + + #endregion Singleton + #region Constructors /// @@ -18,8 +29,7 @@ internal class CleanupActiveCodeCommand : BaseCommand /// /// The hosting package. internal CleanupActiveCodeCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandCleanupActiveCode, PackageIds.CmdIDCodeMaidCleanupActiveCode)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidCleanupActiveCode) { CodeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(Package); CodeCleanupManager = CodeCleanupManager.GetInstance(Package); diff --git a/CodeMaid/Integration/Commands/CleanupAllCodeCommand.cs b/CodeMaid/Integration/Commands/CleanupAllCodeCommand.cs index f6b730f4..2e1bddc3 100644 --- a/CodeMaid/Integration/Commands/CleanupAllCodeCommand.cs +++ b/CodeMaid/Integration/Commands/CleanupAllCodeCommand.cs @@ -1,9 +1,9 @@ using EnvDTE; using SteveCadwallader.CodeMaid.Helpers; using SteveCadwallader.CodeMaid.Logic.Cleaning; +using SteveCadwallader.CodeMaid.Properties; using SteveCadwallader.CodeMaid.UI.Dialogs.CleanupProgress; using System.Collections.Generic; -using System.ComponentModel.Design; using System.Linq; using System.Windows; @@ -12,8 +12,20 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// /// A command that provides for cleaning up code in all documents. /// - internal class CleanupAllCodeCommand : BaseCommand + internal sealed class CleanupAllCodeCommand : BaseCommand { + #region Singleton + + public static CleanupAllCodeCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new CleanupAllCodeCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_CleanupAllCode, Instance.Switch); + } + + #endregion Singleton + #region Constructors /// @@ -21,8 +33,7 @@ internal class CleanupAllCodeCommand : BaseCommand /// /// The hosting package. internal CleanupAllCodeCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandCleanupAllCode, PackageIds.CmdIDCodeMaidCleanupAllCode)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidCleanupAllCode) { CodeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(Package); } @@ -48,12 +59,12 @@ protected override void OnExecute() if (!CodeCleanupAvailabilityLogic.IsCleanupEnvironmentAvailable()) { - MessageBox.Show(@"Cleanup cannot run while debugging.", - @"CodeMaid: Cleanup All Code", + MessageBox.Show(Resources.CleanupCannotRunWhileDebugging, + Resources.CodeMaidCleanupAllCode, MessageBoxButton.OK, MessageBoxImage.Warning); } - else if (MessageBox.Show(@"Are you ready for CodeMaid to clean everything in the solution?", - @"CodeMaid: Confirmation for Cleanup All Code", + else if (MessageBox.Show(Resources.AreYouReadyForCodeMaidToCleanEverythingInTheSolution, + Resources.CodeMaidConfirmationForCleanupAllCode, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) == MessageBoxResult.Yes) { diff --git a/CodeMaid/Integration/Commands/CleanupOpenCodeCommand.cs b/CodeMaid/Integration/Commands/CleanupOpenCodeCommand.cs index 8ffc532f..cfd9653b 100644 --- a/CodeMaid/Integration/Commands/CleanupOpenCodeCommand.cs +++ b/CodeMaid/Integration/Commands/CleanupOpenCodeCommand.cs @@ -3,7 +3,6 @@ using SteveCadwallader.CodeMaid.Logic.Cleaning; using SteveCadwallader.CodeMaid.UI.Dialogs.CleanupProgress; using System.Collections.Generic; -using System.ComponentModel.Design; using System.Linq; namespace SteveCadwallader.CodeMaid.Integration.Commands @@ -11,8 +10,20 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// /// A command that provides for cleaning up code in the open documents. /// - internal class CleanupOpenCodeCommand : BaseCommand + internal sealed class CleanupOpenCodeCommand : BaseCommand { + #region Singleton + + public static CleanupOpenCodeCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new CleanupOpenCodeCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_CleanupOpenCode, Instance.Switch); + } + + #endregion Singleton + #region Constructors /// @@ -20,8 +31,7 @@ internal class CleanupOpenCodeCommand : BaseCommand /// /// The hosting package. internal CleanupOpenCodeCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandCleanupOpenCode, PackageIds.CmdIDCodeMaidCleanupOpenCode)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidCleanupOpenCode) { CodeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(Package); } diff --git a/CodeMaid/Integration/Commands/CleanupSelectedCodeCommand.cs b/CodeMaid/Integration/Commands/CleanupSelectedCodeCommand.cs index 922b6b4f..f0d10c7b 100644 --- a/CodeMaid/Integration/Commands/CleanupSelectedCodeCommand.cs +++ b/CodeMaid/Integration/Commands/CleanupSelectedCodeCommand.cs @@ -3,7 +3,6 @@ using SteveCadwallader.CodeMaid.Logic.Cleaning; using SteveCadwallader.CodeMaid.UI.Dialogs.CleanupProgress; using System.Collections.Generic; -using System.ComponentModel.Design; using System.Linq; namespace SteveCadwallader.CodeMaid.Integration.Commands @@ -11,8 +10,20 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// /// A command that provides for cleaning up code in the selected documents. /// - internal class CleanupSelectedCodeCommand : BaseCommand + internal sealed class CleanupSelectedCodeCommand : BaseCommand { + #region Singleton + + public static CleanupSelectedCodeCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new CleanupSelectedCodeCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_CleanupSelectedCode, Instance.Switch); + } + + #endregion Singleton + #region Constructors /// @@ -20,8 +31,7 @@ internal class CleanupSelectedCodeCommand : BaseCommand /// /// The hosting package. internal CleanupSelectedCodeCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandCleanupSelectedCode, PackageIds.CmdIDCodeMaidCleanupSelectedCode)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidCleanupSelectedCode) { CodeCleanupAvailabilityLogic = CodeCleanupAvailabilityLogic.GetInstance(Package); } diff --git a/CodeMaid/Integration/Commands/CloseAllReadOnlyCommand.cs b/CodeMaid/Integration/Commands/CloseAllReadOnlyCommand.cs index 0184003a..466fa1e5 100644 --- a/CodeMaid/Integration/Commands/CloseAllReadOnlyCommand.cs +++ b/CodeMaid/Integration/Commands/CloseAllReadOnlyCommand.cs @@ -1,5 +1,4 @@ using EnvDTE; -using System.ComponentModel.Design; using System.Linq; namespace SteveCadwallader.CodeMaid.Integration.Commands @@ -7,8 +6,20 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// /// A command that provides for closing all read-only files. /// - internal class CloseAllReadOnlyCommand : BaseCommand + internal sealed class CloseAllReadOnlyCommand : BaseCommand { + #region Singleton + + public static CloseAllReadOnlyCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new CloseAllReadOnlyCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_CloseAllReadOnly, Instance.Switch); + } + + #endregion Singleton + #region Constructors /// @@ -16,8 +27,7 @@ internal class CloseAllReadOnlyCommand : BaseCommand /// /// The hosting package. internal CloseAllReadOnlyCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandCloseAllReadOnly, PackageIds.CmdIDCodeMaidCloseAllReadOnly)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidCloseAllReadOnly) { } diff --git a/CodeMaid/Integration/Commands/CollapseAllSolutionExplorerCommand.cs b/CodeMaid/Integration/Commands/CollapseAllSolutionExplorerCommand.cs index e0fb54c4..99bf86a6 100644 --- a/CodeMaid/Integration/Commands/CollapseAllSolutionExplorerCommand.cs +++ b/CodeMaid/Integration/Commands/CollapseAllSolutionExplorerCommand.cs @@ -1,15 +1,26 @@ using EnvDTE; using SteveCadwallader.CodeMaid.Helpers; using SteveCadwallader.CodeMaid.Properties; -using System.ComponentModel.Design; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for collapsing nodes in the solution explorer tool window. /// - internal class CollapseAllSolutionExplorerCommand : BaseCommand + internal sealed class CollapseAllSolutionExplorerCommand : BaseCommand { + #region Singleton + + public static CollapseAllSolutionExplorerCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new CollapseAllSolutionExplorerCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_CollapseAllSolutionExplorer, Instance.Switch); + } + + #endregion Singleton + #region Fields /// @@ -26,8 +37,7 @@ internal class CollapseAllSolutionExplorerCommand : BaseCommand /// /// The hosting package. internal CollapseAllSolutionExplorerCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandCollapseAllSolutionExplorer, PackageIds.CmdIDCodeMaidCollapseAllSolutionExplorer)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidCollapseAllSolutionExplorer) { } diff --git a/CodeMaid/Integration/Commands/CollapseSelectedSolutionExplorerCommand.cs b/CodeMaid/Integration/Commands/CollapseSelectedSolutionExplorerCommand.cs index 1a465e12..bb541939 100644 --- a/CodeMaid/Integration/Commands/CollapseSelectedSolutionExplorerCommand.cs +++ b/CodeMaid/Integration/Commands/CollapseSelectedSolutionExplorerCommand.cs @@ -1,7 +1,6 @@ using EnvDTE; using SteveCadwallader.CodeMaid.Helpers; using System.Collections.Generic; -using System.ComponentModel.Design; using System.Linq; namespace SteveCadwallader.CodeMaid.Integration.Commands @@ -9,8 +8,20 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// /// A command that provides for collapsing selected nodes in the solution explorer tool window. /// - internal class CollapseSelectedSolutionExplorerCommand : BaseCommand + internal sealed class CollapseSelectedSolutionExplorerCommand : BaseCommand { + #region Singleton + + public static CollapseSelectedSolutionExplorerCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new CollapseSelectedSolutionExplorerCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_CollapseSelectedSolutionExplorer, Instance.Switch); + } + + #endregion Singleton + #region Constructors /// @@ -18,8 +29,7 @@ internal class CollapseSelectedSolutionExplorerCommand : BaseCommand /// /// The hosting package. internal CollapseSelectedSolutionExplorerCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandCollapseSelectedSolutionExplorer, PackageIds.CmdIDCodeMaidCollapseSelectedSolutionExplorer)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidCollapseSelectedSolutionExplorer) { } diff --git a/CodeMaid/Integration/Commands/CommentFormatCommand.cs b/CodeMaid/Integration/Commands/CommentFormatCommand.cs index 0aefa97a..56112cb9 100644 --- a/CodeMaid/Integration/Commands/CommentFormatCommand.cs +++ b/CodeMaid/Integration/Commands/CommentFormatCommand.cs @@ -1,15 +1,27 @@ using EnvDTE; using SteveCadwallader.CodeMaid.Helpers; using SteveCadwallader.CodeMaid.Logic.Formatting; -using System.ComponentModel.Design; +using SteveCadwallader.CodeMaid.Properties; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for formatting the current comment. /// - internal class CommentFormatCommand : BaseCommand + internal sealed class CommentFormatCommand : BaseCommand { + #region Singleton + + public static CommentFormatCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new CommentFormatCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_CommentFormat, Instance.Switch); + } + + #endregion Singleton + #region Fields private readonly CommentFormatLogic _commentFormatLogic; @@ -24,10 +36,9 @@ internal class CommentFormatCommand : BaseCommand /// /// The hosting package. internal CommentFormatCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandCommentFormat, PackageIds.CmdIDCodeMaidCommentFormat)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidCommentFormat) { - _undoTransactionHelper = new UndoTransactionHelper(package, "CodeMaid Format Comment"); + _undoTransactionHelper = new UndoTransactionHelper(package, Resources.CodeMaidFormatComment); _commentFormatLogic = CommentFormatLogic.GetInstance(package); } @@ -81,15 +92,15 @@ protected override void OnExecute() if (foundComments) { - Package.IDE.StatusBar.Text = "CodeMaid finished formatting the comment."; + Package.IDE.StatusBar.Text = Resources.CodeMaidFinishedFormattingTheComment; } else { Package.IDE.StatusBar.Text = string.Format( foundComments - ? "CodeMaid finished formatting the comments {0}." - : "CodeMaid did not find a non-code comment {0} to reformat.", - selection.IsEmpty ? "under the cursor" : "in the selection" + ? Resources.CodeMaidFinishedFormattingTheComments0 + : Resources.CodeMaidDidNotFindANonCodeComment0ToReformat, + selection.IsEmpty ? Resources.UnderTheCursor : Resources.InTheSelection ); } } diff --git a/CodeMaid/Integration/Commands/FindInSolutionExplorerCommand.cs b/CodeMaid/Integration/Commands/FindInSolutionExplorerCommand.cs index a99dd22d..e44452f3 100644 --- a/CodeMaid/Integration/Commands/FindInSolutionExplorerCommand.cs +++ b/CodeMaid/Integration/Commands/FindInSolutionExplorerCommand.cs @@ -5,16 +5,26 @@ using SteveCadwallader.CodeMaid.Helpers; using SteveCadwallader.CodeMaid.Properties; using System; -using System.ComponentModel.Design; -using IServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for finding a file in the solution explorer. /// - internal class FindInSolutionExplorerCommand : BaseCommand + internal sealed class FindInSolutionExplorerCommand : BaseCommand { + #region Singleton + + public static FindInSolutionExplorerCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new FindInSolutionExplorerCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_FindInSolutionExplorer, Instance.Switch); + } + + #endregion Singleton + #region Fields private readonly CommandHelper _commandHelper; @@ -28,8 +38,7 @@ internal class FindInSolutionExplorerCommand : BaseCommand /// /// The hosting package. internal FindInSolutionExplorerCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandFindInSolutionExplorer, PackageIds.CmdIDCodeMaidFindInSolutionExplorer)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidFindInSolutionExplorer) { _commandHelper = CommandHelper.GetInstance(package); } @@ -96,12 +105,9 @@ protected override void OnExecute() /// private void ClearSolutionExplorerSearchFilter() { - if (Package.ServiceProvider != null) - { - var solutionExplorer = VsShellUtilities.GetUIHierarchyWindow(Package.ServiceProvider, VSConstants.StandardToolWindows.SolutionExplorer); - var ws = solutionExplorer as IVsWindowSearch; - ws?.ClearSearch(); - } + var solutionExplorer = VsShellUtilities.GetUIHierarchyWindow(Package, VSConstants.StandardToolWindows.SolutionExplorer); + var ws = solutionExplorer as IVsWindowSearch; + ws?.ClearSearch(); } /// diff --git a/CodeMaid/Integration/Commands/JoinLinesCommand.cs b/CodeMaid/Integration/Commands/JoinLinesCommand.cs index a98fdbf8..0609fa3f 100644 --- a/CodeMaid/Integration/Commands/JoinLinesCommand.cs +++ b/CodeMaid/Integration/Commands/JoinLinesCommand.cs @@ -1,14 +1,26 @@ using EnvDTE; using SteveCadwallader.CodeMaid.Helpers; -using System.ComponentModel.Design; +using SteveCadwallader.CodeMaid.Properties; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for joining lines together. /// - internal class JoinLinesCommand : BaseCommand + internal sealed class JoinLinesCommand : BaseCommand { + #region Singleton + + public static JoinLinesCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new JoinLinesCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_JoinLines, Instance.Switch); + } + + #endregion Singleton + #region Fields private readonly UndoTransactionHelper _undoTransactionHelper; @@ -22,10 +34,9 @@ internal class JoinLinesCommand : BaseCommand /// /// The hosting package. internal JoinLinesCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandJoinLines, PackageIds.CmdIDCodeMaidJoinLines)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidJoinLines) { - _undoTransactionHelper = new UndoTransactionHelper(package, "CodeMaid Join"); + _undoTransactionHelper = new UndoTransactionHelper(package, Resources.CodeMaidJoin); } #endregion Constructors diff --git a/CodeMaid/Integration/Commands/OptionsCommand.cs b/CodeMaid/Integration/Commands/OptionsCommand.cs index bd1eedc2..589b0e6b 100644 --- a/CodeMaid/Integration/Commands/OptionsCommand.cs +++ b/CodeMaid/Integration/Commands/OptionsCommand.cs @@ -1,13 +1,24 @@ using SteveCadwallader.CodeMaid.UI.Dialogs.Options; -using System.ComponentModel.Design; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for launching the CodeMaid Options to the general cleanup page. /// - internal class OptionsCommand : BaseCommand + internal sealed class OptionsCommand : BaseCommand { + #region Singleton + + public static OptionsCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new OptionsCommand(package); + Instance.Switch(on: true); + } + + #endregion Singleton + #region Constructors /// @@ -15,8 +26,7 @@ internal class OptionsCommand : BaseCommand /// /// The hosting package. internal OptionsCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandOptions, PackageIds.CmdIDCodeMaidOptions)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidOptions) { } diff --git a/CodeMaid/Integration/Commands/ReadOnlyToggleCommand.cs b/CodeMaid/Integration/Commands/ReadOnlyToggleCommand.cs index fc9abf73..097be179 100644 --- a/CodeMaid/Integration/Commands/ReadOnlyToggleCommand.cs +++ b/CodeMaid/Integration/Commands/ReadOnlyToggleCommand.cs @@ -1,7 +1,7 @@ using EnvDTE; using SteveCadwallader.CodeMaid.Helpers; +using SteveCadwallader.CodeMaid.Properties; using System; -using System.ComponentModel.Design; using System.IO; namespace SteveCadwallader.CodeMaid.Integration.Commands @@ -9,8 +9,20 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// /// A command that provides for toggling the read only attribute of a file. /// - internal class ReadOnlyToggleCommand : BaseCommand + internal sealed class ReadOnlyToggleCommand : BaseCommand { + #region Singleton + + public static ReadOnlyToggleCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new ReadOnlyToggleCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_ReadOnlyToggle, Instance.Switch); + } + + #endregion Singleton + #region Constructors /// @@ -18,8 +30,7 @@ internal class ReadOnlyToggleCommand : BaseCommand /// /// The hosting package. internal ReadOnlyToggleCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandReadOnlyToggle, PackageIds.CmdIDCodeMaidReadOnlyToggle)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidReadOnlyToggle) { } @@ -54,7 +65,7 @@ protected override void OnExecute() } catch (Exception ex) { - OutputWindowHelper.ExceptionWriteLine($"Unable to toggle read only state on '{document.FullName}'", ex); + OutputWindowHelper.ExceptionWriteLine($"{ Resources.UnableToToggleReadOnlyStateOn}'{document.FullName}'", ex); } } } diff --git a/CodeMaid/Integration/Commands/RemoveRegionCommand.cs b/CodeMaid/Integration/Commands/RemoveRegionCommand.cs index e2edff39..3a9996f5 100644 --- a/CodeMaid/Integration/Commands/RemoveRegionCommand.cs +++ b/CodeMaid/Integration/Commands/RemoveRegionCommand.cs @@ -2,15 +2,27 @@ using SteveCadwallader.CodeMaid.Helpers; using SteveCadwallader.CodeMaid.Logic.Cleaning; using SteveCadwallader.CodeMaid.Model; -using System.ComponentModel.Design; +using SteveCadwallader.CodeMaid.Properties; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for removing region(s). /// - internal class RemoveRegionCommand : BaseCommand + internal sealed class RemoveRegionCommand : BaseCommand { + #region Singleton + + public static RemoveRegionCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new RemoveRegionCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_RemoveRegion, Instance.Switch); + } + + #endregion Singleton + #region Fields private readonly CodeModelHelper _codeModelHelper; @@ -25,8 +37,7 @@ internal class RemoveRegionCommand : BaseCommand /// /// The hosting package. internal RemoveRegionCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandRemoveRegion, PackageIds.CmdIDCodeMaidRemoveRegion)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidRemoveRegion) { _codeModelHelper = CodeModelHelper.GetInstance(package); _removeRegionLogic = RemoveRegionLogic.GetInstance(package); @@ -63,15 +74,15 @@ protected override void OnBeforeQueryStatus() switch (regionCommandScope) { case RegionCommandScope.CurrentLine: - Text = "&Remove Current Region"; + Text = Resources.RemoveCurrentRegion; break; case RegionCommandScope.Selection: - Text = "&Remove Selected Regions"; + Text = Resources.RemoveSelectedRegions; break; default: - Text = "&Remove All Regions"; + Text = Resources.RemoveAllRegions; break; } } diff --git a/CodeMaid/Integration/Commands/ReorganizeActiveCodeCommand.cs b/CodeMaid/Integration/Commands/ReorganizeActiveCodeCommand.cs index 08e3cffa..a6e4ecac 100644 --- a/CodeMaid/Integration/Commands/ReorganizeActiveCodeCommand.cs +++ b/CodeMaid/Integration/Commands/ReorganizeActiveCodeCommand.cs @@ -1,13 +1,24 @@ using SteveCadwallader.CodeMaid.Logic.Reorganizing; -using System.ComponentModel.Design; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for reorganizing code in the active document. /// - internal class ReorganizeActiveCodeCommand : BaseCommand + internal sealed class ReorganizeActiveCodeCommand : BaseCommand { + #region Singleton + + public static ReorganizeActiveCodeCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new ReorganizeActiveCodeCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_ReorganizeActiveCode, Instance.Switch); + } + + #endregion Singleton + #region Fields private readonly CodeReorganizationAvailabilityLogic _codeReorganizationAvailabilityLogic; @@ -21,8 +32,7 @@ internal class ReorganizeActiveCodeCommand : BaseCommand /// /// The hosting package. internal ReorganizeActiveCodeCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandReorganizeActiveCode, PackageIds.CmdIDCodeMaidReorganizeActiveCode)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidReorganizeActiveCode) { CodeReorganizationManager = CodeReorganizationManager.GetInstance(Package); diff --git a/CodeMaid/Integration/Commands/SettingCleanupOnSaveCommand.cs b/CodeMaid/Integration/Commands/SettingCleanupOnSaveCommand.cs index be5673e0..904514bb 100644 --- a/CodeMaid/Integration/Commands/SettingCleanupOnSaveCommand.cs +++ b/CodeMaid/Integration/Commands/SettingCleanupOnSaveCommand.cs @@ -1,13 +1,24 @@ using SteveCadwallader.CodeMaid.Properties; -using System.ComponentModel.Design; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for changing the setting for cleanup on save. /// - internal class SettingCleanupOnSaveCommand : BaseCommand + internal sealed class SettingCleanupOnSaveCommand : BaseCommand { + #region Singleton + + public static SettingCleanupOnSaveCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SettingCleanupOnSaveCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_SettingCleanupOnSave, Instance.Switch); + } + + #endregion Singleton + #region Constructors /// @@ -15,8 +26,7 @@ internal class SettingCleanupOnSaveCommand : BaseCommand /// /// The hosting package. internal SettingCleanupOnSaveCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSettingCleanupOnSave, PackageIds.CmdIDCodeMaidSettingCleanupOnSave)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSettingCleanupOnSave) { } @@ -36,7 +46,7 @@ public bool CleanupOnSave /// /// Gets an ON/OFF string based on the state. /// - public string CleanupOnSaveStateText => CleanupOnSave ? "ON" : "OFF"; + public string CleanupOnSaveStateText => CleanupOnSave ? Resources.SettingCleanupOnSaveCommand_ON : Resources.SettingCleanupOnSaveCommand_OFF; #endregion Properties @@ -48,7 +58,7 @@ public bool CleanupOnSave protected override void OnBeforeQueryStatus() { Checked = CleanupOnSave; - Text = "Automatic Cleanup On Save - " + CleanupOnSaveStateText; + Text = Resources.AutomaticCleanupOnSave + CleanupOnSaveStateText; } /// @@ -61,7 +71,7 @@ protected override void OnExecute() CleanupOnSave = !CleanupOnSave; Settings.Default.Save(); - Package.IDE.StatusBar.Text = $"CodeMaid turned automatic cleanup on save {CleanupOnSaveStateText}."; + Package.IDE.StatusBar.Text = $"{Resources.CodeMaidTurnedAutomaticCleanupOnSave} {CleanupOnSaveStateText}."; } #endregion BaseCommand Methods diff --git a/CodeMaid/Integration/Commands/SortLinesCommand.cs b/CodeMaid/Integration/Commands/SortLinesCommand.cs index adcf2480..b5b47a66 100644 --- a/CodeMaid/Integration/Commands/SortLinesCommand.cs +++ b/CodeMaid/Integration/Commands/SortLinesCommand.cs @@ -1,7 +1,7 @@ using EnvDTE; using SteveCadwallader.CodeMaid.Helpers; +using SteveCadwallader.CodeMaid.Properties; using System; -using System.ComponentModel.Design; using System.Linq; using System.Text; using TextSelection = EnvDTE.TextSelection; @@ -11,8 +11,20 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// /// A command that provides for sorting lines. /// - internal class SortLinesCommand : BaseCommand + internal sealed class SortLinesCommand : BaseCommand { + #region Singleton + + public static SortLinesCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SortLinesCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_SortLines, Instance.Switch); + } + + #endregion Singleton + #region Fields private readonly UndoTransactionHelper _undoTransactionHelper; @@ -26,10 +38,9 @@ internal class SortLinesCommand : BaseCommand /// /// The hosting package. internal SortLinesCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSortLines, PackageIds.CmdIDCodeMaidSortLines)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSortLines) { - _undoTransactionHelper = new UndoTransactionHelper(package, "CodeMaid Sort"); + _undoTransactionHelper = new UndoTransactionHelper(package, Resources.CodeMaidSort); } #endregion Constructors diff --git a/CodeMaid/Integration/Commands/SpadeContextDeleteCommand.cs b/CodeMaid/Integration/Commands/SpadeContextDeleteCommand.cs index 3878b2f6..19e6f149 100644 --- a/CodeMaid/Integration/Commands/SpadeContextDeleteCommand.cs +++ b/CodeMaid/Integration/Commands/SpadeContextDeleteCommand.cs @@ -1,8 +1,8 @@ using EnvDTE; using SteveCadwallader.CodeMaid.Helpers; using SteveCadwallader.CodeMaid.Model.CodeItems; +using SteveCadwallader.CodeMaid.Properties; using System; -using System.ComponentModel.Design; using System.Linq; namespace SteveCadwallader.CodeMaid.Integration.Commands @@ -10,8 +10,20 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// /// A command that provides for deleting a member within Spade. /// - internal class SpadeContextDeleteCommand : BaseCommand + internal sealed class SpadeContextDeleteCommand : BaseCommand { + #region Singleton + + public static SpadeContextDeleteCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SpadeContextDeleteCommand(package); + Instance.Switch(on: true); + } + + #endregion Singleton + #region Fields private readonly UndoTransactionHelper _undoTransactionHelper; @@ -25,10 +37,9 @@ internal class SpadeContextDeleteCommand : BaseCommand /// /// The hosting package. internal SpadeContextDeleteCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSpadeContextDelete, PackageIds.CmdIDCodeMaidSpadeContextDelete)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeContextDelete) { - _undoTransactionHelper = new UndoTransactionHelper(package, "CodeMaid Delete Items"); + _undoTransactionHelper = new UndoTransactionHelper(package, Resources.CodeMaidDeleteItems); } #endregion Constructors diff --git a/CodeMaid/Integration/Commands/SpadeContextFindReferencesCommand.cs b/CodeMaid/Integration/Commands/SpadeContextFindReferencesCommand.cs index 51f011a2..e4bb2d81 100644 --- a/CodeMaid/Integration/Commands/SpadeContextFindReferencesCommand.cs +++ b/CodeMaid/Integration/Commands/SpadeContextFindReferencesCommand.cs @@ -1,6 +1,5 @@ using EnvDTE; using SteveCadwallader.CodeMaid.Model.CodeItems; -using System.ComponentModel.Design; using System.Linq; namespace SteveCadwallader.CodeMaid.Integration.Commands @@ -8,8 +7,20 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// /// A command that provides for finding references of a member within Spade. /// - internal class SpadeContextFindReferencesCommand : BaseCommand + internal sealed class SpadeContextFindReferencesCommand : BaseCommand { + #region Singleton + + public static SpadeContextFindReferencesCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SpadeContextFindReferencesCommand(package); + Instance.Switch(on: true); + } + + #endregion Singleton + #region Constructors /// @@ -17,8 +28,7 @@ internal class SpadeContextFindReferencesCommand : BaseCommand /// /// The hosting package. internal SpadeContextFindReferencesCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSpadeContextFindReferences, PackageIds.CmdIDCodeMaidSpadeContextFindReferences)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeContextFindReferences) { } diff --git a/CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs b/CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs index 8baaf5a2..f484d32f 100644 --- a/CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs +++ b/CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs @@ -2,7 +2,6 @@ using SteveCadwallader.CodeMaid.Logic.Reorganizing; using SteveCadwallader.CodeMaid.Model.CodeItems; using SteveCadwallader.CodeMaid.Properties; -using System.ComponentModel.Design; using System.Linq; namespace SteveCadwallader.CodeMaid.Integration.Commands @@ -10,8 +9,20 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// /// A command that provides for inserting a region within Spade. /// - internal class SpadeContextInsertRegionCommand : BaseCommand + internal sealed class SpadeContextInsertRegionCommand : BaseCommand { + #region Singleton + + public static SpadeContextInsertRegionCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SpadeContextInsertRegionCommand(package); + Instance.Switch(on: true); + } + + #endregion Singleton + #region Fields private readonly GenerateRegionLogic _generateRegionLogic; @@ -26,11 +37,10 @@ internal class SpadeContextInsertRegionCommand : BaseCommand /// /// The hosting package. internal SpadeContextInsertRegionCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSpadeContextInsertRegion, PackageIds.CmdIDCodeMaidSpadeContextInsertRegion)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeContextInsertRegion) { _generateRegionLogic = GenerateRegionLogic.GetInstance(package); - _undoTransactionHelper = new UndoTransactionHelper(package, "CodeMaid Insert Region"); + _undoTransactionHelper = new UndoTransactionHelper(package, Resources.CodeMaidInsertRegion); } #endregion Constructors @@ -65,7 +75,7 @@ protected override void OnExecute() var spade = Package.Spade; if (spade != null) { - var region = new CodeItemRegion { Name = "New Region" }; + var region = new CodeItemRegion { Name = Resources.NewRegion }; var startPoint = spade.SelectedItems.OrderBy(x => x.StartOffset).First().StartPoint; var endPoint = spade.SelectedItems.OrderBy(x => x.EndOffset).Last().EndPoint; diff --git a/CodeMaid/Integration/Commands/SpadeContextRemoveRegionCommand.cs b/CodeMaid/Integration/Commands/SpadeContextRemoveRegionCommand.cs index 33f53558..932f1521 100644 --- a/CodeMaid/Integration/Commands/SpadeContextRemoveRegionCommand.cs +++ b/CodeMaid/Integration/Commands/SpadeContextRemoveRegionCommand.cs @@ -1,6 +1,5 @@ using SteveCadwallader.CodeMaid.Logic.Cleaning; using SteveCadwallader.CodeMaid.Model.CodeItems; -using System.ComponentModel.Design; using System.Linq; namespace SteveCadwallader.CodeMaid.Integration.Commands @@ -8,8 +7,20 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// /// A command that provides for removing a region within Spade. /// - internal class SpadeContextRemoveRegionCommand : BaseCommand + internal sealed class SpadeContextRemoveRegionCommand : BaseCommand { + #region Singleton + + public static SpadeContextRemoveRegionCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SpadeContextRemoveRegionCommand(package); + Instance.Switch(on: true); + } + + #endregion Singleton + #region Fields private readonly RemoveRegionLogic _removeRegionLogic; @@ -23,8 +34,7 @@ internal class SpadeContextRemoveRegionCommand : BaseCommand /// /// The hosting package. internal SpadeContextRemoveRegionCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSpadeContextRemoveRegion, PackageIds.CmdIDCodeMaidSpadeContextRemoveRegion)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeContextRemoveRegion) { _removeRegionLogic = RemoveRegionLogic.GetInstance(package); } diff --git a/CodeMaid/Integration/Commands/SpadeOptionsCommand.cs b/CodeMaid/Integration/Commands/SpadeOptionsCommand.cs index 2e0e2420..d5692720 100644 --- a/CodeMaid/Integration/Commands/SpadeOptionsCommand.cs +++ b/CodeMaid/Integration/Commands/SpadeOptionsCommand.cs @@ -1,14 +1,25 @@ using SteveCadwallader.CodeMaid.UI.Dialogs.Options; using SteveCadwallader.CodeMaid.UI.Dialogs.Options.Digging; -using System.ComponentModel.Design; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for launching the CodeMaid Options to the Spade page. /// - internal class SpadeOptionsCommand : BaseCommand + internal sealed class SpadeOptionsCommand : BaseCommand { + #region Singleton + + public static SpadeOptionsCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SpadeOptionsCommand(package); + Instance.Switch(on: true); + } + + #endregion Singleton + #region Constructors /// @@ -16,8 +27,7 @@ internal class SpadeOptionsCommand : BaseCommand /// /// The hosting package. internal SpadeOptionsCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSpadeOptions, PackageIds.CmdIDCodeMaidSpadeOptions)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeOptions) { } diff --git a/CodeMaid/Integration/Commands/SpadeRefreshCommand.cs b/CodeMaid/Integration/Commands/SpadeRefreshCommand.cs index 5532bf35..52b0c04d 100644 --- a/CodeMaid/Integration/Commands/SpadeRefreshCommand.cs +++ b/CodeMaid/Integration/Commands/SpadeRefreshCommand.cs @@ -1,12 +1,22 @@ -using System.ComponentModel.Design; - namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for refreshing the Spade tool window. /// - internal class SpadeRefreshCommand : BaseCommand + internal sealed class SpadeRefreshCommand : BaseCommand { + #region Singleton + + public static SpadeRefreshCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SpadeRefreshCommand(package); + Instance.Switch(on: true); + } + + #endregion Singleton + #region Constructors /// @@ -14,8 +24,7 @@ internal class SpadeRefreshCommand : BaseCommand /// /// The hosting package. internal SpadeRefreshCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSpadeRefresh, PackageIds.CmdIDCodeMaidSpadeRefresh)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeRefresh) { } diff --git a/CodeMaid/Integration/Commands/SpadeSearchCommand.cs b/CodeMaid/Integration/Commands/SpadeSearchCommand.cs index ac9832bc..30cd01ce 100644 --- a/CodeMaid/Integration/Commands/SpadeSearchCommand.cs +++ b/CodeMaid/Integration/Commands/SpadeSearchCommand.cs @@ -1,12 +1,22 @@ -using System.ComponentModel.Design; - -namespace SteveCadwallader.CodeMaid.Integration.Commands +namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for setting focus on the search bar in the Spade tool window. /// - internal class SpadeSearchCommand : BaseCommand + internal sealed class SpadeSearchCommand : BaseCommand { + #region Singleton + + public static SpadeSearchCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SpadeSearchCommand(package); + Instance.Switch(on: true); + } + + #endregion Singleton + #region Constructors /// @@ -14,8 +24,7 @@ internal class SpadeSearchCommand : BaseCommand /// /// The hosting package. internal SpadeSearchCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSpadeSearch, PackageIds.CmdIDCodeMaidSpadeSearch)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeSearch) { } diff --git a/CodeMaid/Integration/Commands/SpadeSortOrderAlphaCommand.cs b/CodeMaid/Integration/Commands/SpadeSortOrderAlphaCommand.cs index 9cee6264..bbcbb249 100644 --- a/CodeMaid/Integration/Commands/SpadeSortOrderAlphaCommand.cs +++ b/CodeMaid/Integration/Commands/SpadeSortOrderAlphaCommand.cs @@ -1,13 +1,24 @@ using SteveCadwallader.CodeMaid.Model.CodeTree; -using System.ComponentModel.Design; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for setting Spade to alphabetical sort order. /// - internal class SpadeSortOrderAlphaCommand : BaseCommand + internal sealed class SpadeSortOrderAlphaCommand : BaseCommand { + #region Singleton + + public static SpadeSortOrderAlphaCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SpadeSortOrderAlphaCommand(package); + Instance.Switch(on: true); + } + + #endregion Singleton + #region Constructors /// @@ -15,8 +26,7 @@ internal class SpadeSortOrderAlphaCommand : BaseCommand /// /// The hosting package. internal SpadeSortOrderAlphaCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSpadeSortOrderAlpha, PackageIds.CmdIDCodeMaidSpadeSortOrderAlpha)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeSortOrderAlpha) { } diff --git a/CodeMaid/Integration/Commands/SpadeSortOrderFileCommand.cs b/CodeMaid/Integration/Commands/SpadeSortOrderFileCommand.cs index f45b23c3..23fb149d 100644 --- a/CodeMaid/Integration/Commands/SpadeSortOrderFileCommand.cs +++ b/CodeMaid/Integration/Commands/SpadeSortOrderFileCommand.cs @@ -1,13 +1,24 @@ using SteveCadwallader.CodeMaid.Model.CodeTree; -using System.ComponentModel.Design; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for setting Spade to file sort order. /// - internal class SpadeSortOrderFileCommand : BaseCommand + internal sealed class SpadeSortOrderFileCommand : BaseCommand { + #region Singleton + + public static SpadeSortOrderFileCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SpadeSortOrderFileCommand(package); + Instance.Switch(on: true); + } + + #endregion Singleton + #region Constructors /// @@ -15,8 +26,7 @@ internal class SpadeSortOrderFileCommand : BaseCommand /// /// The hosting package. internal SpadeSortOrderFileCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSpadeSortOrderFile, PackageIds.CmdIDCodeMaidSpadeSortOrderFile)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeSortOrderFile) { } diff --git a/CodeMaid/Integration/Commands/SpadeSortOrderTypeCommand.cs b/CodeMaid/Integration/Commands/SpadeSortOrderTypeCommand.cs index 87df8767..b04af42e 100644 --- a/CodeMaid/Integration/Commands/SpadeSortOrderTypeCommand.cs +++ b/CodeMaid/Integration/Commands/SpadeSortOrderTypeCommand.cs @@ -1,13 +1,24 @@ using SteveCadwallader.CodeMaid.Model.CodeTree; -using System.ComponentModel.Design; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for setting Spade to type sort order. /// - internal class SpadeSortOrderTypeCommand : BaseCommand + internal sealed class SpadeSortOrderTypeCommand : BaseCommand { + #region Singleton + + public static SpadeSortOrderTypeCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SpadeSortOrderTypeCommand(package); + Instance.Switch(on: true); + } + + #endregion Singleton + #region Constructors /// @@ -15,8 +26,7 @@ internal class SpadeSortOrderTypeCommand : BaseCommand /// /// The hosting package. internal SpadeSortOrderTypeCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSpadeSortOrderType, PackageIds.CmdIDCodeMaidSpadeSortOrderType)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeSortOrderType) { } diff --git a/CodeMaid/Integration/Commands/SpadeToolWindowCommand.cs b/CodeMaid/Integration/Commands/SpadeToolWindowCommand.cs index 5de3fd1f..925eeb08 100644 --- a/CodeMaid/Integration/Commands/SpadeToolWindowCommand.cs +++ b/CodeMaid/Integration/Commands/SpadeToolWindowCommand.cs @@ -1,14 +1,25 @@ using EnvDTE; using Microsoft.VisualStudio.Shell.Interop; -using System.ComponentModel.Design; namespace SteveCadwallader.CodeMaid.Integration.Commands { /// /// A command that provides for launching the Spade tool window. /// - internal class SpadeToolWindowCommand : BaseCommand + internal sealed class SpadeToolWindowCommand : BaseCommand { + #region Singleton + + public static SpadeToolWindowCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SpadeToolWindowCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_SpadeToolWindow, Instance.Switch); + } + + #endregion Singleton + #region Constructors /// @@ -16,8 +27,7 @@ internal class SpadeToolWindowCommand : BaseCommand /// /// The hosting package. internal SpadeToolWindowCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSpadeToolWindow, PackageIds.CmdIDCodeMaidSpadeToolWindow)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeToolWindow) { } @@ -43,6 +53,16 @@ protected override void OnExecute() } } + public override void Switch(bool on) + { + base.Switch(on); + + if (!on) + { + Package.Spade?.Close(); + } + } + #endregion BaseCommand Methods #region Internal Methods diff --git a/CodeMaid/Integration/Commands/SwitchFileCommand.cs b/CodeMaid/Integration/Commands/SwitchFileCommand.cs index 725abe7a..4c2a1a6b 100644 --- a/CodeMaid/Integration/Commands/SwitchFileCommand.cs +++ b/CodeMaid/Integration/Commands/SwitchFileCommand.cs @@ -3,7 +3,6 @@ using SteveCadwallader.CodeMaid.Properties; using System; using System.Collections.Generic; -using System.ComponentModel.Design; using System.IO; using System.Linq; @@ -12,8 +11,20 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// /// A command that provides for switching between files based on their filename. /// - internal class SwitchFileCommand : BaseCommand + internal sealed class SwitchFileCommand : BaseCommand { + #region Singleton + + public static SwitchFileCommand Instance { get; private set; } + + public static void Initialize(CodeMaidPackage package) + { + Instance = new SwitchFileCommand(package); + package.SettingsMonitor.Watch(s => s.Feature_SwitchFile, Instance.Switch); + } + + #endregion Singleton + #region Constructors /// @@ -21,8 +32,7 @@ internal class SwitchFileCommand : BaseCommand /// /// The hosting package. internal SwitchFileCommand(CodeMaidPackage package) - : base(package, - new CommandID(PackageGuids.GuidCodeMaidCommandSwitchFile, PackageIds.CmdIDCodeMaidSwitchFile)) + : base(package, PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSwitchFile) { } @@ -41,11 +51,11 @@ protected override void OnBeforeQueryStatus() Enabled = canAlterate; if (canAlterate) { - Text = "S&witch to " + Path.GetFileName(alternatePath); + Text = Resources.SWitchTo + Path.GetFileName(alternatePath); } else { - Text = "S&witch File"; + Text = Resources.SWitchFile; } } diff --git a/CodeMaid/Integration/Events/BaseEventListener.cs b/CodeMaid/Integration/Events/BaseEventListener.cs index b70f6eaf..0ed3fc84 100644 --- a/CodeMaid/Integration/Events/BaseEventListener.cs +++ b/CodeMaid/Integration/Events/BaseEventListener.cs @@ -5,7 +5,7 @@ namespace SteveCadwallader.CodeMaid.Integration.Events /// /// The base implementation of an event listener. /// - internal abstract class BaseEventListener : IDisposable + internal abstract class BaseEventListener : ISwitchableFeature, IDisposable { #region Constructors @@ -29,6 +29,30 @@ protected BaseEventListener(CodeMaidPackage package) #endregion Properties + #region ISwitchable Members + + protected bool IsListening { get; set; } + + public void Switch(bool on) + { + if (on && !IsListening) + { + IsListening = true; + RegisterListeners(); + } + else if (IsListening && !on) + { + IsListening = false; + UnRegisterListeners(); + } + } + + protected abstract void RegisterListeners(); + + protected abstract void UnRegisterListeners(); + + #endregion ISwitchable Members + #region IDisposable Members /// diff --git a/CodeMaid/Integration/Events/BuildProgressEventListener.cs b/CodeMaid/Integration/Events/BuildProgressEventListener.cs index 745beaeb..54040587 100644 --- a/CodeMaid/Integration/Events/BuildProgressEventListener.cs +++ b/CodeMaid/Integration/Events/BuildProgressEventListener.cs @@ -6,8 +6,17 @@ namespace SteveCadwallader.CodeMaid.Integration.Events /// /// A class that encapsulates listening for build progress events. /// - internal class BuildProgressEventListener : BaseEventListener + internal sealed class BuildProgressEventListener : BaseEventListener { + #region Singleton + + public static BuildProgressEventListener Instance { get; private set; } + + public static void Intialize(CodeMaidPackage package) + => Instance = new BuildProgressEventListener(package); + + #endregion Singleton + #region Constructors /// @@ -19,10 +28,7 @@ internal BuildProgressEventListener(CodeMaidPackage package) { // Store access to the build events, otherwise events will not register properly via DTE. BuildEvents = Package.IDE.Events.BuildEvents; - BuildEvents.OnBuildBegin += BuildEvents_OnBuildBegin; - BuildEvents.OnBuildProjConfigBegin += BuildEvents_OnBuildProjConfigBegin; - BuildEvents.OnBuildProjConfigDone += BuildEvents_OnBuildProjConfigDone; - BuildEvents.OnBuildDone += BuildEvents_OnBuildDone; + package.SettingsMonitor.Watch(s => s.Feature_BuildProgressToolWindow, Switch); } #endregion Constructors @@ -133,6 +139,26 @@ private void BuildEvents_OnBuildDone(vsBuildScope scope, vsBuildAction action) #endregion Private Event Handlers + #region ISwitchable Members + + protected override void RegisterListeners() + { + BuildEvents.OnBuildBegin += BuildEvents_OnBuildBegin; + BuildEvents.OnBuildProjConfigBegin += BuildEvents_OnBuildProjConfigBegin; + BuildEvents.OnBuildProjConfigDone += BuildEvents_OnBuildProjConfigDone; + BuildEvents.OnBuildDone += BuildEvents_OnBuildDone; + } + + protected override void UnRegisterListeners() + { + BuildEvents.OnBuildBegin -= BuildEvents_OnBuildBegin; + BuildEvents.OnBuildProjConfigBegin -= BuildEvents_OnBuildProjConfigBegin; + BuildEvents.OnBuildProjConfigDone -= BuildEvents_OnBuildProjConfigDone; + BuildEvents.OnBuildDone -= BuildEvents_OnBuildDone; + } + + #endregion ISwitchable Members + #region IDisposable Members /// @@ -150,10 +176,7 @@ protected override void Dispose(bool disposing) if (disposing && BuildEvents != null) { - BuildEvents.OnBuildBegin -= BuildEvents_OnBuildBegin; - BuildEvents.OnBuildProjConfigBegin -= BuildEvents_OnBuildProjConfigBegin; - BuildEvents.OnBuildProjConfigDone -= BuildEvents_OnBuildProjConfigDone; - BuildEvents.OnBuildDone -= BuildEvents_OnBuildDone; + Switch(on: false); } } } diff --git a/CodeMaid/Integration/Events/DocumentEventListener.cs b/CodeMaid/Integration/Events/DocumentEventListener.cs index 6aca7f28..726c70e0 100644 --- a/CodeMaid/Integration/Events/DocumentEventListener.cs +++ b/CodeMaid/Integration/Events/DocumentEventListener.cs @@ -7,8 +7,17 @@ namespace SteveCadwallader.CodeMaid.Integration.Events /// /// A class that encapsulates listening for document events. /// - internal class DocumentEventListener : BaseEventListener + internal sealed class DocumentEventListener : BaseEventListener { + #region Singleton + + public static DocumentEventListener Instance { get; private set; } + + public static void Intialize(CodeMaidPackage package) + => Instance = new DocumentEventListener(package); + + #endregion Singleton + #region Constructors /// @@ -20,7 +29,7 @@ internal DocumentEventListener(CodeMaidPackage package) { // Store access to the document events, otherwise events will not register properly via DTE. DocumentEvents = Package.IDE.Events.DocumentEvents; - DocumentEvents.DocumentClosing += DocumentEvents_DocumentClosing; + Switch(on: true); } #endregion Constructors @@ -62,6 +71,20 @@ private void DocumentEvents_DocumentClosing(Document document) #endregion Private Event Handlers + #region ISwitchable Members + + protected override void RegisterListeners() + { + DocumentEvents.DocumentClosing += DocumentEvents_DocumentClosing; + } + + protected override void UnRegisterListeners() + { + DocumentEvents.DocumentClosing -= DocumentEvents_DocumentClosing; + } + + #endregion ISwitchable Members + #region IDisposable Members /// @@ -79,7 +102,7 @@ protected override void Dispose(bool disposing) if (disposing && DocumentEvents != null) { - DocumentEvents.DocumentClosing -= DocumentEvents_DocumentClosing; + Switch(on: false); } } } diff --git a/CodeMaid/Integration/Events/RunningDocumentTableEventListener.cs b/CodeMaid/Integration/Events/RunningDocumentTableEventListener.cs index 9cbc1fbc..e7687b2e 100644 --- a/CodeMaid/Integration/Events/RunningDocumentTableEventListener.cs +++ b/CodeMaid/Integration/Events/RunningDocumentTableEventListener.cs @@ -3,6 +3,7 @@ using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; using SteveCadwallader.CodeMaid.Helpers; +using SteveCadwallader.CodeMaid.Properties; using System.Linq; namespace SteveCadwallader.CodeMaid.Integration.Events @@ -10,8 +11,17 @@ namespace SteveCadwallader.CodeMaid.Integration.Events /// /// A class that listens for running document table events. /// - internal class RunningDocumentTableEventListener : BaseEventListener, IVsRunningDocTableEvents3 + internal sealed class RunningDocumentTableEventListener : BaseEventListener, IVsRunningDocTableEvents3 { + #region Singleton + + public static RunningDocumentTableEventListener Instance { get; private set; } + + public static void Intialize(CodeMaidPackage package) + => Instance = new RunningDocumentTableEventListener(package); + + #endregion Singleton + #region Constructors /// @@ -24,8 +34,14 @@ internal RunningDocumentTableEventListener(CodeMaidPackage package) // Create and store a reference to the running document table. RunningDocumentTable = new RunningDocumentTable(package); - // Register with the running document table for events. - EventCookie = RunningDocumentTable.Advise(this); + // This listener services multiple features, watching if any of them switched. + package.SettingsMonitor.Watch(new[] { + nameof(Settings.Default.Feature_SettingCleanupOnSave), + nameof(Settings.Default.Feature_SpadeToolWindow) + }, values => + { + Switch(values.Any(v => v)); + }); } #endregion Constructors @@ -156,6 +172,22 @@ public int OnBeforeSave(uint docCookie) #endregion IVsRunningDocTableEvents3 Members + #region ISwitchable Members + + protected override void RegisterListeners() + { + // Register with the running document table for events. + EventCookie = RunningDocumentTable.Advise(this); + } + + protected override void UnRegisterListeners() + { + RunningDocumentTable.Unadvise(EventCookie); + EventCookie = 0; + } + + #endregion ISwitchable Members + #region IDisposable Members /// @@ -173,8 +205,7 @@ protected override void Dispose(bool disposing) if (disposing && RunningDocumentTable != null && EventCookie != 0) { - RunningDocumentTable.Unadvise(EventCookie); - EventCookie = 0; + Switch(on: false); } } } diff --git a/CodeMaid/Integration/Events/ShellEventListener.cs b/CodeMaid/Integration/Events/ShellEventListener.cs deleted file mode 100644 index 3817ee93..00000000 --- a/CodeMaid/Integration/Events/ShellEventListener.cs +++ /dev/null @@ -1,160 +0,0 @@ -using Microsoft.VisualStudio; -using Microsoft.VisualStudio.Shell.Interop; -using SteveCadwallader.CodeMaid.Helpers; -using System; - -namespace SteveCadwallader.CodeMaid.Integration.Events -{ - /// - /// A class that encapsulates listening for shell events. - /// - internal class ShellEventListener : BaseEventListener, IVsBroadcastMessageEvents, IVsShellPropertyEvents - { - #region Constants - - private const uint WM_SYSCOLORCHANGE = 0x0015; - - #endregion Constants - - #region Constructors - - /// - /// Initializes a new instance of the class. - /// - /// The package hosting the event listener. - /// The shell service. - internal ShellEventListener(CodeMaidPackage package, IVsShell shellService) - : base(package) - { - _shellService = shellService; - if (_shellService != null) - { - _shellService.AdviseBroadcastMessages(this, out _broadcastEventCookie); - _shellService.AdviseShellPropertyChanges(this, out _propertyEventCookie); - } - } - - #endregion Constructors - - #region Internal Events - - /// - /// An event raised when an environment color has changed. - /// - internal event Action EnvironmentColorChanged; - - /// - /// An event raised when the shell is available. - /// - internal event Action ShellAvailable; - - #endregion Internal Events - - #region Private Fields - - /// - /// An event cookie used as a notification token for broadcast events. - /// - private uint _broadcastEventCookie; - - /// - /// An event cookie used as a notification token for property events. - /// - private uint _propertyEventCookie; - - /// - /// The shell service. - /// - private readonly IVsShell _shellService; - - #endregion Private Fields - - #region IVsBroadcastMessageEvents Members - - /// - /// Called when a message is broadcast to the environment window. - /// - /// The notification message. - /// The word value parameter. - /// The long integer parameter. - /// S_OK if successful, otherwise an error code. - public int OnBroadcastMessage(uint msg, IntPtr wParam, IntPtr lParam) - { - if (msg == WM_SYSCOLORCHANGE) - { - var environmentColorChanged = EnvironmentColorChanged; - if (environmentColorChanged != null) - { - OutputWindowHelper.DiagnosticWriteLine("ShellEventListener.EnvironmentColorChanged raised"); - - environmentColorChanged(); - } - } - - return VSConstants.S_OK; - } - - #endregion IVsBroadcastMessageEvents Members - - #region IVsShellPropertyEvents Members - - /// - /// Called when a shell property has changed. - /// - /// The id of the property that changed. - /// The new value of the property. - /// S_OK if successful, otherwise an error code. - public int OnShellPropertyChange(int propid, object var) - { - // Check if the zombie state property of the shell has changed to false. - if ((int)__VSSPROPID.VSSPROPID_Zombie == propid && ((bool)var == false)) - { - var shellAvailable = ShellAvailable; - if (shellAvailable != null) - { - OutputWindowHelper.DiagnosticWriteLine("ShellEventListener.ShellAvailable raised"); - - shellAvailable(); - } - } - - return VSConstants.S_OK; - } - - #endregion IVsShellPropertyEvents Members - - #region IDisposable Members - - /// - /// Releases unmanaged and - optionally - managed resources - /// - /// - /// true to release both managed and unmanaged resources; false to release - /// only unmanaged resources. - /// - protected override void Dispose(bool disposing) - { - if (!IsDisposed) - { - IsDisposed = true; - - if (disposing && _shellService != null) - { - if (_broadcastEventCookie != 0) - { - _shellService.UnadviseBroadcastMessages(_broadcastEventCookie); - _broadcastEventCookie = 0; - } - - if (_propertyEventCookie != 0) - { - _shellService.UnadviseShellPropertyChanges(_propertyEventCookie); - _propertyEventCookie = 0; - } - } - } - } - - #endregion IDisposable Members - } -} \ No newline at end of file diff --git a/CodeMaid/Integration/Events/SolutionEventListener.cs b/CodeMaid/Integration/Events/SolutionEventListener.cs index 9bc1d38d..13d23666 100644 --- a/CodeMaid/Integration/Events/SolutionEventListener.cs +++ b/CodeMaid/Integration/Events/SolutionEventListener.cs @@ -7,8 +7,17 @@ namespace SteveCadwallader.CodeMaid.Integration.Events /// /// A class that encapsulates listening for solution events. /// - internal class SolutionEventListener : BaseEventListener + internal sealed class SolutionEventListener : BaseEventListener { + #region Singleton + + public static SolutionEventListener Instance { get; private set; } + + public static void Intialize(CodeMaidPackage package) + => Instance = new SolutionEventListener(package); + + #endregion Singleton + #region Constructors /// @@ -20,8 +29,7 @@ internal SolutionEventListener(CodeMaidPackage package) { // Store access to the solutions events, otherwise events will not register properly via DTE. SolutionEvents = Package.IDE.Events.SolutionEvents; - SolutionEvents.Opened += SolutionEvents_Opened; - SolutionEvents.AfterClosing += SolutionEvents_AfterClosing; + Switch(on: true); } #endregion Constructors @@ -38,6 +46,8 @@ internal SolutionEventListener(CodeMaidPackage package) /// internal event Action OnSolutionClosed; + internal void FireSolutionOpenedEvent() => SolutionEvents_Opened(); + #endregion Internal Events #region Private Properties @@ -81,6 +91,22 @@ private void SolutionEvents_AfterClosing() #endregion Private Methods + #region ISwitchable Members + + protected override void RegisterListeners() + { + SolutionEvents.Opened += SolutionEvents_Opened; + SolutionEvents.AfterClosing += SolutionEvents_AfterClosing; + } + + protected override void UnRegisterListeners() + { + SolutionEvents.Opened -= SolutionEvents_Opened; + SolutionEvents.AfterClosing -= SolutionEvents_AfterClosing; + } + + #endregion ISwitchable Members + #region IDisposable Members /// @@ -98,8 +124,7 @@ protected override void Dispose(bool disposing) if (disposing && SolutionEvents != null) { - SolutionEvents.Opened -= SolutionEvents_Opened; - SolutionEvents.AfterClosing -= SolutionEvents_AfterClosing; + Switch(on: false); } } } diff --git a/CodeMaid/Integration/Events/TextEditorEventListener.cs b/CodeMaid/Integration/Events/TextEditorEventListener.cs index e85db33a..744936be 100644 --- a/CodeMaid/Integration/Events/TextEditorEventListener.cs +++ b/CodeMaid/Integration/Events/TextEditorEventListener.cs @@ -7,8 +7,17 @@ namespace SteveCadwallader.CodeMaid.Integration.Events /// /// A class that encapsulates listening for text editor events. /// - internal class TextEditorEventListener : BaseEventListener + internal sealed class TextEditorEventListener : BaseEventListener { + #region Singleton + + public static TextEditorEventListener Instance { get; private set; } + + public static void Intialize(CodeMaidPackage package) + => Instance = new TextEditorEventListener(package); + + #endregion Singleton + #region Constructors /// @@ -21,7 +30,7 @@ internal TextEditorEventListener(CodeMaidPackage package) // Store access to the text editor events, otherwise events will not register properly // via DTE. TextEditorEvents = Package.IDE.Events.TextEditorEvents; - TextEditorEvents.LineChanged += TextEditorEvents_LineChanged; + Switch(on: true); } #endregion Constructors @@ -70,6 +79,20 @@ private void TextEditorEvents_LineChanged(TextPoint startPoint, TextPoint endPoi #endregion Private Event Handlers + #region ISwitchable Members + + protected override void RegisterListeners() + { + TextEditorEvents.LineChanged += TextEditorEvents_LineChanged; + } + + protected override void UnRegisterListeners() + { + TextEditorEvents.LineChanged -= TextEditorEvents_LineChanged; + } + + #endregion ISwitchable Members + #region IDisposable Members /// @@ -87,7 +110,7 @@ protected override void Dispose(bool disposing) if (disposing && TextEditorEvents != null) { - TextEditorEvents.LineChanged -= TextEditorEvents_LineChanged; + Switch(on: false); } } } diff --git a/CodeMaid/Integration/Events/WindowEventListener.cs b/CodeMaid/Integration/Events/WindowEventListener.cs index 1b6974cb..b61fbb04 100644 --- a/CodeMaid/Integration/Events/WindowEventListener.cs +++ b/CodeMaid/Integration/Events/WindowEventListener.cs @@ -7,8 +7,17 @@ namespace SteveCadwallader.CodeMaid.Integration.Events /// /// A class that encapsulates listening for window events. /// - internal class WindowEventListener : BaseEventListener + internal sealed class WindowEventListener : BaseEventListener { + #region Singleton + + public static WindowEventListener Instance { get; private set; } + + public static void Intialize(CodeMaidPackage package) + => Instance = new WindowEventListener(package); + + #endregion Singleton + #region Constructors /// @@ -19,8 +28,8 @@ internal WindowEventListener(CodeMaidPackage package) : base(package) { // Store access to the window events, otherwise events will not register properly via DTE. - WindowEvents = Package.IDE.Events.get_WindowEvents(null); - WindowEvents.WindowActivated += WindowEvents_WindowActivated; + WindowEvents = Package.IDE.Events.WindowEvents; + package.SettingsMonitor.Watch(s => s.Feature_SpadeToolWindow, Switch); } #endregion Constructors @@ -83,6 +92,20 @@ private void RaiseWindowChange(Document document) #endregion Private Methods + #region ISwitchable Members + + protected override void RegisterListeners() + { + WindowEvents.WindowActivated += WindowEvents_WindowActivated; + } + + protected override void UnRegisterListeners() + { + WindowEvents.WindowActivated -= WindowEvents_WindowActivated; + } + + #endregion ISwitchable Members + #region IDisposable Members /// @@ -100,7 +123,7 @@ protected override void Dispose(bool disposing) if (disposing && WindowEvents != null) { - WindowEvents.WindowActivated -= WindowEvents_WindowActivated; + Switch(on: false); } } } diff --git a/CodeMaid/Integration/ISwitchableFeature.cs b/CodeMaid/Integration/ISwitchableFeature.cs new file mode 100644 index 00000000..2dd241e4 --- /dev/null +++ b/CodeMaid/Integration/ISwitchableFeature.cs @@ -0,0 +1,7 @@ +namespace SteveCadwallader.CodeMaid.Integration +{ + internal interface ISwitchableFeature + { + void Switch(bool on); + } +} \ No newline at end of file diff --git a/CodeMaid/Integration/Images/about.png b/CodeMaid/Integration/Images/about.png index 921de4ec..f25b8cff 100644 Binary files a/CodeMaid/Integration/Images/about.png and b/CodeMaid/Integration/Images/about.png differ diff --git a/CodeMaid/Integration/Images/about.xcf b/CodeMaid/Integration/Images/about.xcf index c64e4c83..1df5a61c 100644 Binary files a/CodeMaid/Integration/Images/about.xcf and b/CodeMaid/Integration/Images/about.xcf differ diff --git a/CodeMaid/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs b/CodeMaid/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs index 3d5604d5..ecca7164 100644 --- a/CodeMaid/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs +++ b/CodeMaid/Logic/Cleaning/CodeCleanupAvailabilityLogic.cs @@ -415,10 +415,10 @@ private static bool PromptUserAboutCleaningExternalFiles(Document document) { var viewModel = new YesNoPromptViewModel { - Title = @"CodeMaid: Cleanup External File", - Message = document.Name + " is not in the solution so some cleanup actions may be unavailable." + + Title = Resources.CodeMaidCleanupExternalFile, + Message = document.Name + Resources.IsNotInTheSolutionSoSomeCleanupActionsMayBeUnavailable + Environment.NewLine + Environment.NewLine + - "Do you want to perform a partial cleanup?", + Resources.DoYouWantToPerformAPartialCleanup, CanRemember = true }; diff --git a/CodeMaid/Logic/Cleaning/CodeCleanupManager.cs b/CodeMaid/Logic/Cleaning/CodeCleanupManager.cs index a036f048..7703f1a6 100644 --- a/CodeMaid/Logic/Cleaning/CodeCleanupManager.cs +++ b/CodeMaid/Logic/Cleaning/CodeCleanupManager.cs @@ -157,19 +157,19 @@ internal void Cleanup(Document document) _codeReorganizationManager.Reorganize(document); } - new UndoTransactionHelper(_package, $"CodeMaid Cleanup for '{document.Name}'").Run( + new UndoTransactionHelper(_package, string.Format(Resources.CodeMaidCleanupFor0, document.Name)).Run( delegate { var cleanupMethod = FindCodeCleanupMethod(document); if (cleanupMethod != null) { OutputWindowHelper.DiagnosticWriteLine($"CodeCleanupManager.Cleanup started for '{document.FullName}'"); - _package.IDE.StatusBar.Text = $"CodeMaid is cleaning '{document.Name}'..."; + _package.IDE.StatusBar.Text = string.Format(Resources.CodeMaidIsCleaning0, document.Name); // Perform the set of configured cleanups based on the language. cleanupMethod(document); - _package.IDE.StatusBar.Text = $"CodeMaid cleaned '{document.Name}'."; + _package.IDE.StatusBar.Text = string.Format(Resources.CodeMaidCleaned0, document.Name); OutputWindowHelper.DiagnosticWriteLine($"CodeCleanupManager.Cleanup completed for '{document.FullName}'"); } }); @@ -580,7 +580,7 @@ private void RunXAMLStylerCleanup(TextDocument textDocument) { if (!Settings.Default.ThirdParty_UseXAMLStylerCleanup) return; - _commandHelper.ExecuteCommand(textDocument, "EditorContextMenus.XAMLEditor.BeautifyXaml", "EditorContextMenus.XAMLEditor.FormatXAML"); + _commandHelper.ExecuteCommand(textDocument, "EditorContextMenus.XAMLEditor.BeautifyXaml", "EditorContextMenus.XAMLEditor.FormatXAML", "EditorContextMenus.CodeWindow.FormatXAML"); } /// diff --git a/CodeMaid/Logic/Cleaning/RemoveRegionLogic.cs b/CodeMaid/Logic/Cleaning/RemoveRegionLogic.cs index 5c764d83..8bc094f7 100644 --- a/CodeMaid/Logic/Cleaning/RemoveRegionLogic.cs +++ b/CodeMaid/Logic/Cleaning/RemoveRegionLogic.cs @@ -75,7 +75,7 @@ internal void RemoveRegions(TextDocument textDocument) // Retrieve the regions and put them in reverse order (reduces line number updates during removal). var regions = _codeModelHelper.RetrieveCodeRegions(textDocument).OrderByDescending(x => x.StartLine); - new UndoTransactionHelper(_package, "CodeMaid Remove All Regions").Run(() => + new UndoTransactionHelper(_package, Resources.CodeMaidRemoveAllRegions).Run(() => { foreach (var region in regions) { @@ -93,7 +93,7 @@ internal void RemoveRegions(TextSelection textSelection) // Retrieve the regions and put them in reverse order (reduces line number updates during removal). var regions = _codeModelHelper.RetrieveCodeRegions(textSelection).OrderByDescending(x => x.StartLine); - new UndoTransactionHelper(_package, "CodeMaid Remove Selected Regions").Run(() => + new UndoTransactionHelper(_package, Resources.CodeMaidRemoveSelectedRegions).Run(() => { foreach (var region in regions) { @@ -108,7 +108,7 @@ internal void RemoveRegions(TextSelection textSelection) /// The regions to update. internal void RemoveRegions(IEnumerable regions) { - new UndoTransactionHelper(_package, "CodeMaid Remove Regions").Run(() => + new UndoTransactionHelper(_package, Resources.CodeMaidRemoveRegions).Run(() => { // Iterate through regions in reverse order (reduces line number updates during removal). foreach (var region in regions.OrderByDescending(x => x.StartLine)) @@ -151,7 +151,7 @@ internal void RemoveRegion(CodeItemRegion region) return; } - new UndoTransactionHelper(_package, "CodeMaid Remove Region " + region.Name).Run(() => + new UndoTransactionHelper(_package, Resources.CodeMaidRemoveRegion + region.Name).Run(() => { var end = region.EndPoint.CreateEditPoint(); end.StartOfLine(); diff --git a/CodeMaid/Logic/Digging/OutliningSynchronizationManager.cs b/CodeMaid/Logic/Digging/OutliningSynchronizationManager.cs index 518387d8..e34df8e8 100644 --- a/CodeMaid/Logic/Digging/OutliningSynchronizationManager.cs +++ b/CodeMaid/Logic/Digging/OutliningSynchronizationManager.cs @@ -274,7 +274,7 @@ private IWpfTextView GetWpfTextView(Document document) /// The associated text view, otherwise null. private IVsTextView GetTextView(Document document) { - if (_package.ServiceProvider == null || document == null) + if (document == null) { return null; } @@ -283,7 +283,7 @@ private IVsTextView GetTextView(Document document) uint itemID; IVsWindowFrame windowFrame; - if (VsShellUtilities.IsDocumentOpen(_package.ServiceProvider, document.FullName, Guid.Empty, out hierarchy, out itemID, out windowFrame)) + if (VsShellUtilities.IsDocumentOpen(_package, document.FullName, Guid.Empty, out hierarchy, out itemID, out windowFrame)) { return VsShellUtilities.GetTextView(windowFrame); } diff --git a/CodeMaid/Logic/Formatting/CommentFormatLogic.cs b/CodeMaid/Logic/Formatting/CommentFormatLogic.cs index 01b84c23..fda0112a 100644 --- a/CodeMaid/Logic/Formatting/CommentFormatLogic.cs +++ b/CodeMaid/Logic/Formatting/CommentFormatLogic.cs @@ -2,6 +2,7 @@ using SteveCadwallader.CodeMaid.Helpers; using SteveCadwallader.CodeMaid.Model.Comments; using SteveCadwallader.CodeMaid.Properties; +using System.Linq; namespace SteveCadwallader.CodeMaid.Logic.Formatting { @@ -57,13 +58,22 @@ public void FormatComments(TextDocument textDocument) public bool FormatComments(TextDocument textDocument, EditPoint start, EditPoint end) { bool foundComments = false; - int tabSize = CodeCommentHelper.GetTabSize(_package, textDocument); + + var options = new FormatterOptions + { + TabSize = CodeCommentHelper.GetTabSize(_package, textDocument), + IgnoreTokens = CodeCommentHelper + .GetTaskListTokens(_package) + .Concat(Settings.Default.Formatting_IgnoreLinesStartingWith.Cast()) + .ToArray() + }; while (start.Line <= end.Line) { if (CodeCommentHelper.IsCommentLine(start)) { - var comment = new CodeComment(start, tabSize); + var comment = new CodeComment(start, options); + if (comment.IsValid) { comment.Format(); @@ -89,10 +99,10 @@ public bool FormatComments(TextDocument textDocument, EditPoint start, EditPoint } /// - /// Gets an instance of the class. + /// Gets an instance of the class. /// /// The hosting package. - /// An instance of the class. + /// An instance of the class. internal static CommentFormatLogic GetInstance(CodeMaidPackage package) { return _instance ?? (_instance = new CommentFormatLogic(package)); diff --git a/CodeMaid/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs b/CodeMaid/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs index acd13cd2..d8cf7c1e 100644 --- a/CodeMaid/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs +++ b/CodeMaid/Logic/Reorganizing/CodeReorganizationAvailabilityLogic.cs @@ -168,10 +168,8 @@ private static bool PromptUserAboutReorganizingPreprocessorConditionals(Document { var viewModel = new YesNoPromptViewModel { - Title = @"CodeMaid: Reorganize Preprocessor Conditionals", - Message = document.Name + " contains preprocessor conditionals (e.g. #if, #pragma) which reorganization does not currently support." + - Environment.NewLine + Environment.NewLine + - "Do you want to reorganize anyways (DANGEROUS)?", + Title = @Resources.CodeMaidReorganizePreprocessorConditionals, + Message = string.Format(Resources.ContainsPreprocessorConditionalsEGIfPragmaWhichReorganizationDoesNotCurrentlySupportRNRNDoYouWantToReorganizeAnywaysDANGEROUS, document.Name), CanRemember = true }; diff --git a/CodeMaid/Logic/Reorganizing/CodeReorganizationManager.cs b/CodeMaid/Logic/Reorganizing/CodeReorganizationManager.cs index 8a825a04..367a0c07 100644 --- a/CodeMaid/Logic/Reorganizing/CodeReorganizationManager.cs +++ b/CodeMaid/Logic/Reorganizing/CodeReorganizationManager.cs @@ -73,7 +73,7 @@ private CodeReorganizationManager(CodeMaidPackage package) /// The base item. internal void MoveItemAboveBase(BaseCodeItem itemToMove, BaseCodeItem baseItem) { - new UndoTransactionHelper(_package, "CodeMaid Move Item Above").Run( + new UndoTransactionHelper(_package, Resources.CodeMaidMoveItemAbove).Run( () => RepositionItemAboveBase(itemToMove, baseItem)); } @@ -84,7 +84,7 @@ internal void MoveItemAboveBase(BaseCodeItem itemToMove, BaseCodeItem baseItem) /// The base item. internal void MoveItemBelowBase(BaseCodeItem itemToMove, BaseCodeItem baseItem) { - new UndoTransactionHelper(_package, "CodeMaid Move Item Below").Run( + new UndoTransactionHelper(_package, Resources.CodeMaidMoveItemBelow).Run( () => RepositionItemBelowBase(itemToMove, baseItem)); } @@ -95,7 +95,7 @@ internal void MoveItemBelowBase(BaseCodeItem itemToMove, BaseCodeItem baseItem) /// The base item. internal void MoveItemIntoBase(BaseCodeItem itemToMove, ICodeItemParent baseItem) { - new UndoTransactionHelper(_package, "CodeMaid Move Item Into").Run( + new UndoTransactionHelper(_package, Resources.CodeMaidMoveItemInto).Run( () => RepositionItemIntoBase(itemToMove, baseItem)); } @@ -107,11 +107,11 @@ internal void Reorganize(Document document) { if (!_codeReorganizationAvailabilityLogic.CanReorganize(document, true)) return; - new UndoTransactionHelper(_package, $"CodeMaid Reorganize for '{document.Name}'").Run( + new UndoTransactionHelper(_package, string.Format(Resources.CodeMaidReorganizeFor0, document.Name)).Run( delegate { OutputWindowHelper.DiagnosticWriteLine($"CodeReorganizationManager.Reorganize started for '{document.FullName}'"); - _package.IDE.StatusBar.Text = $"CodeMaid is reorganizing '{document.Name}'..."; + _package.IDE.StatusBar.Text = string.Format(Resources.Reorganize_CodeMaidIsReorganizing0, document.Name); // Retrieve all relevant code items (excluding using statements). var rawCodeItems = _codeModelManager.RetrieveAllCodeItems(document).Where(x => !(x is CodeItemUsingStatement)); @@ -123,7 +123,7 @@ internal void Reorganize(Document document) // Recursively reorganize the code tree. RecursivelyReorganize(codeTree); - _package.IDE.StatusBar.Text = $"CodeMaid reorganized '{document.Name}'."; + _package.IDE.StatusBar.Text = string.Format(Resources.CodeMaidReorganized0, document.Name); OutputWindowHelper.DiagnosticWriteLine($"CodeReorganizationManager.Reorganize completed for '{document.FullName}'"); }); } diff --git a/CodeMaid/Model/CodeItems/IInterfaceItem.cs b/CodeMaid/Model/CodeItems/IInterfaceItem.cs index 7a58cdb1..dfc35e96 100644 --- a/CodeMaid/Model/CodeItems/IInterfaceItem.cs +++ b/CodeMaid/Model/CodeItems/IInterfaceItem.cs @@ -10,4 +10,4 @@ public interface IInterfaceItem /// bool IsExplicitInterfaceImplementation { get; } } -} +} \ No newline at end of file diff --git a/CodeMaid/Model/CodeModelManager.cs b/CodeMaid/Model/CodeModelManager.cs index a7bf58bc..f9aaa225 100644 --- a/CodeMaid/Model/CodeModelManager.cs +++ b/CodeMaid/Model/CodeModelManager.cs @@ -112,7 +112,7 @@ internal SetCodeItems RetrieveAllCodeItems(Document document, bool loadLazyIniti var codeModel = _codeModelCache.GetCodeModel(document); if (codeModel.IsBuilding) { - if (!codeModel.IsBuiltWaitHandle.WaitOne(TimeSpan.FromSeconds(30))) + if (!codeModel.IsBuiltWaitHandle.WaitOne(TimeSpan.FromSeconds(3))) { OutputWindowHelper.WarningWriteLine( $"Timed out waiting for code model to be built for '{codeModel.Document.FullName}'"); diff --git a/CodeMaid/Model/Comments/CodeComment.cs b/CodeMaid/Model/Comments/CodeComment.cs index df84772e..f42dea94 100644 --- a/CodeMaid/Model/Comments/CodeComment.cs +++ b/CodeMaid/Model/Comments/CodeComment.cs @@ -17,7 +17,7 @@ internal class CodeComment private readonly TextDocument _document; private readonly Regex _commentLineRegex; - private readonly int _tabSize; + private readonly FormatterOptions _formatterOptions; private EditPoint _endPoint; private EditPoint _startPoint; @@ -29,7 +29,7 @@ internal class CodeComment /// /// Initializes a new instance of the class. /// - public CodeComment(TextPoint point, int tabSize) + public CodeComment(TextPoint point, FormatterOptions options) { if (point == null) { @@ -38,7 +38,7 @@ public CodeComment(TextPoint point, int tabSize) _document = point.Parent; _commentLineRegex = CodeCommentHelper.GetCommentRegex(_document.GetCodeLanguage()); - _tabSize = tabSize; + _formatterOptions = options; Expand(point); } @@ -60,12 +60,22 @@ public CodeComment(TextPoint point, int tabSize) /// /// Helper function to generate the preview in the options menu. /// - public static string FormatXml(string text) + public static string FormatXml(string text, string prefix = "///") { var xml = XElement.Parse($"{text}"); - var line = new CommentLineXml(xml); - var regex = CodeCommentHelper.GetCommentRegex(CodeLanguage.CSharp, false); - var formatter = new CommentFormatter(line, "///", 4, regex); + + var formatter = new CommentFormatter( + new CommentLineXml(xml), + new FormatterOptions + { + IgnoreTokens = new[] { "TODO: " }, + TabSize = 4 + }, + new CommentOptions + { + Prefix = prefix, + Regex = CodeCommentHelper.GetCommentRegex(CodeLanguage.CSharp, !string.IsNullOrWhiteSpace(prefix)) + }); return formatter.ToString(); } @@ -82,7 +92,12 @@ public TextPoint Format() var originalText = _startPoint.GetText(_endPoint); var matches = _commentLineRegex.Matches(originalText).OfType().ToArray(); - var commentPrefix = matches.First(m => m.Success).Groups["prefix"].Value; + + var commentOptions = new CommentOptions + { + Prefix = matches.First(m => m.Success).Groups["prefix"].Value ?? string.Empty, + Regex = CodeCommentHelper.GetCommentRegex(_document.GetCodeLanguage(), false) + }; // Concatenate the comment lines without comment prefixes and see if the resulting bit // can be parsed as XML. @@ -109,9 +124,8 @@ public TextPoint Format() var formatter = new CommentFormatter( line, - commentPrefix, - _tabSize, - CodeCommentHelper.GetCommentRegex(_document.GetCodeLanguage(), false)); + _formatterOptions, + commentOptions); if (!formatter.Equals(originalText)) { diff --git a/CodeMaid/Model/Comments/CommentFormatter.cs b/CodeMaid/Model/Comments/CommentFormatter.cs index 132b68a6..68a98edb 100644 --- a/CodeMaid/Model/Comments/CommentFormatter.cs +++ b/CodeMaid/Model/Comments/CommentFormatter.cs @@ -14,30 +14,30 @@ internal class CommentFormatter : IEquatable { #region Fields + private readonly FormatterOptions _formatterOptions; + private readonly CommentOptions _commentOptions; + private StringBuilder _builder; - private string _commentPrefix; private int _commentPrefixLength; private int _currentPosition; private bool _isAfterCommentPrefix; private bool _isFirstWord; private bool _isIndented; - private Regex _regex; - private int _tabSize; #endregion Fields #region Constructors - public CommentFormatter(ICommentLine line, string commentPrefix, int tabSize, Regex regex) + public CommentFormatter(ICommentLine line, FormatterOptions formatterOptions, CommentOptions commentOptions) { + _formatterOptions = formatterOptions; + _commentOptions = commentOptions; + _builder = new StringBuilder(); _currentPosition = 0; - _regex = regex; - _tabSize = tabSize; _isFirstWord = true; _isIndented = false; - _commentPrefix = commentPrefix ?? string.Empty; - _commentPrefixLength = WordLength(_commentPrefix); + _commentPrefixLength = WordLength(commentOptions.Prefix); // Special handling for the root XML line, it should not output it's surrounding xml // tags, only it's child lines. @@ -130,7 +130,7 @@ private void NewLine(bool force = false) _currentPosition = 0; } - _builder.Append(_commentPrefix); + _builder.Append(_commentOptions.Prefix); _currentPosition += _commentPrefixLength; _isFirstWord = true; _isIndented = false; @@ -160,7 +160,7 @@ private bool Parse(ICommentLine line, int indentLevel = 0, int xmlTagLength = 0) } else if (line.Content != null) { - var matches = _regex.Matches(line.Content).OfType().Select(x => new CodeCommentMatch(x)).ToList(); + var matches = _commentOptions.Regex.Matches(line.Content).OfType().Select(x => new CodeCommentMatch(x, _formatterOptions)).ToList(); // Remove empty matches from the start and end of the comment. CodeCommentMatch m; @@ -216,10 +216,6 @@ private bool Parse(ICommentLine line, int indentLevel = 0, int xmlTagLength = 0) { NewLine(); } - else if (!_isFirstWord && Settings.Default.Formatting_CommentXmlSpaceTags) - { - Append(CodeCommentHelper.Spacer); - } // Always consider the word after the opening tag as the first word to prevent an // extra space before. @@ -227,7 +223,7 @@ private bool Parse(ICommentLine line, int indentLevel = 0, int xmlTagLength = 0) foreach (var match in matches) { - if (match.IsList) + if (match.IsLiteral || match.IsList) { if (!_isFirstWord) { @@ -235,10 +231,14 @@ private bool Parse(ICommentLine line, int indentLevel = 0, int xmlTagLength = 0) } Indent(indentLevel); + } + + if (match.IsList) + { Append(match.ListPrefix); - // List items include their spacing and do not require additional space, - // thus we are logically still on the first word. + // List items include their spacing and do not require additional space, thus + // we are logically still on the first word. _isFirstWord = true; } @@ -274,8 +274,8 @@ private bool Parse(ICommentLine line, int indentLevel = 0, int xmlTagLength = 0) NewLine(); Indent(indentLevel); - // If linewrap is on a list item, add extra spacing to align the - // text with the previous line. + // If linewrap is on a list item, add extra spacing to align the text + // with the previous line. if (match.IsList) { Append(string.Empty.PadLeft(WordLength(match.ListPrefix), CodeCommentHelper.Spacer)); @@ -305,11 +305,6 @@ private bool Parse(ICommentLine line, int indentLevel = 0, int xmlTagLength = 0) } } - if (!forceBreak && Settings.Default.Formatting_CommentXmlSpaceTags) - { - Append(CodeCommentHelper.Spacer); - } - if (_currentPosition == 0 || _currentPosition > _commentPrefixLength && forceBreak) { // This comment fitted on a single line. @@ -355,7 +350,7 @@ private bool ParseXml(CommentLineXml line, int indentLevel = 0) if (isCopyrightTag && Settings.Default.Formatting_CommentXmlValueIndent < 1) { _commentPrefixLength += CodeCommentHelper.CopyrightExtraIndent; - _commentPrefix += string.Empty.PadLeft(CodeCommentHelper.CopyrightExtraIndent); + _commentOptions.Prefix += string.Empty.PadLeft(CodeCommentHelper.CopyrightExtraIndent); } // Increase the indent level. @@ -366,6 +361,11 @@ private bool ParseXml(CommentLineXml line, int indentLevel = 0) // If true the tag should be alone on it's own line. tagOnOwnLine |= isLiteralContent; + if (!tagOnOwnLine && Settings.Default.Formatting_CommentXmlSpaceTags) + { + Append(CodeCommentHelper.Spacer); + } + // If the literal content of an XML tag is set, output that content without formatting. if (isLiteralContent) { @@ -392,8 +392,8 @@ private bool ParseXml(CommentLineXml line, int indentLevel = 0) { if (needBreakBefore) NewLine(); - // Parse function returns true if it had to wrap lines. If so, we need to force - // a newline before the closing tag. + // Parse function returns true if it had to wrap lines. If so, we need to force a + // newline before the closing tag. needBreakBefore = Parse(l, indentLevel, xmlTagLength); tagOnOwnLine |= needBreakBefore; } @@ -405,16 +405,20 @@ private bool ParseXml(CommentLineXml line, int indentLevel = 0) if (isCopyrightTag && Settings.Default.Formatting_CommentXmlValueIndent < 1) { _commentPrefixLength -= CodeCommentHelper.CopyrightExtraIndent; - _commentPrefix = _commentPrefix.Substring(0, _commentPrefixLength); + _commentOptions.Prefix = _commentOptions.Prefix.Substring(0, _commentPrefixLength); } // If opening tag was on own line, do the same for the closing tag. if (tagOnOwnLine && !_isFirstWord) { NewLine(); + Indent(indentLevel); + } + else if (Settings.Default.Formatting_CommentXmlSpaceTags) + { + Append(CodeCommentHelper.Spacer); } - Indent(indentLevel); Append(line.CloseTag); return tagOnOwnLine || CommentLineXml.SingleLineElementNames.Contains(line.TagName, StringComparer.OrdinalIgnoreCase); @@ -458,7 +462,7 @@ private bool TagsOnOwnLine(CommentLineXml line, int indentlevel) /// The length of the string. private int WordLength(string word) { - return word == null ? 0 : word.Length + word.Count(c => c == '\t') * (_tabSize - 1); + return word == null ? 0 : word.Length + word.Count(c => c == '\t') * (_formatterOptions.TabSize - 1); } #endregion Methods diff --git a/CodeMaid/Model/Comments/CommentMatch.cs b/CodeMaid/Model/Comments/CommentMatch.cs index 8f77fc06..fbe4af41 100644 --- a/CodeMaid/Model/Comments/CommentMatch.cs +++ b/CodeMaid/Model/Comments/CommentMatch.cs @@ -8,7 +8,7 @@ internal class CodeCommentMatch { #region Constructors - public CodeCommentMatch(Match match) + public CodeCommentMatch(Match match, FormatterOptions formatterOptions) { if (!match.Success) { @@ -16,12 +16,23 @@ public CodeCommentMatch(Match match) return; } - Indent = match.Groups["indent"].Success ? match.Groups["indent"].Value.Length : 0; - ListPrefix = match.Groups["listprefix"].Success ? match.Groups["listprefix"].Value : null; - Words = match.Groups["words"].Success ? match.Groups["words"].Captures.OfType().Select(c => c.Value).ToList() : null; + if (formatterOptions.IgnoreTokens.Any(p => match.Value.StartsWith(p))) + { + Words = new List { match.Groups["line"].Value }; + IsLiteral = true; + IsEmpty = false; + IsList = false; + } + else + { + Indent = match.Groups["indent"].Success ? match.Groups["indent"].Value.Length : 0; + ListPrefix = match.Groups["listprefix"].Success ? match.Groups["listprefix"].Value : null; + Words = match.Groups["words"].Success ? match.Groups["words"].Captures.OfType().Select(c => c.Value).ToList() : null; - IsEmpty = string.IsNullOrWhiteSpace(match.Value) || Words == null || Words.Count < 1; - IsList = !string.IsNullOrWhiteSpace(ListPrefix); + IsLiteral = false; + IsEmpty = string.IsNullOrWhiteSpace(match.Value) || Words == null || Words.Count < 1; + IsList = !string.IsNullOrWhiteSpace(ListPrefix); + } // In the case of a list prefix but no content (e.g. hyphen line) convert to regular content. if (IsEmpty && IsList) @@ -43,6 +54,8 @@ public CodeCommentMatch(Match match) public bool IsList { get; private set; } + public bool IsLiteral { get; private set; } + public int Length { get @@ -81,6 +94,9 @@ public bool TryAppend(CodeCommentMatch other) if (IsList && other.Indent < 1) return false; + if (IsLiteral || other.IsLiteral) + return false; + foreach (var word in other.Words) Words.Add(word); diff --git a/CodeMaid/Model/Comments/CommentOptions.cs b/CodeMaid/Model/Comments/CommentOptions.cs new file mode 100644 index 00000000..126b415a --- /dev/null +++ b/CodeMaid/Model/Comments/CommentOptions.cs @@ -0,0 +1,14 @@ +using System.Text.RegularExpressions; + +namespace SteveCadwallader.CodeMaid.Model.Comments +{ + /// + /// Comment specific options for the formatter. + /// + internal class CommentOptions + { + public string Prefix { get; internal set; } + + public Regex Regex { get; internal set; } + } +} \ No newline at end of file diff --git a/CodeMaid/Model/Comments/FormatterOptions.cs b/CodeMaid/Model/Comments/FormatterOptions.cs new file mode 100644 index 00000000..2ff24770 --- /dev/null +++ b/CodeMaid/Model/Comments/FormatterOptions.cs @@ -0,0 +1,15 @@ +namespace SteveCadwallader.CodeMaid.Model.Comments +{ + /// + /// Document wide options for the comment formatter. + /// + internal class FormatterOptions + { + public int TabSize { get; internal set; } + + /// + /// The list of comment prefix tokens to ignore while formatting the comment. + /// + public string[] IgnoreTokens { get; internal set; } + } +} \ No newline at end of file diff --git a/CodeMaid/Properties/Resources.Designer.cs b/CodeMaid/Properties/Resources.Designer.cs new file mode 100644 index 00000000..0cc8f7bf --- /dev/null +++ b/CodeMaid/Properties/Resources.Designer.cs @@ -0,0 +1,2476 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace SteveCadwallader.CodeMaid.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SteveCadwallader.CodeMaid.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Unable to import . + /// + public static string _UnableToImport { + get { + return ResourceManager.GetString("_UnableToImport", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Access levels should be ordered by. + /// + public static string AccessLevelsShouldBeOrderedBy { + get { + return ResourceManager.GetString("AccessLevelsShouldBeOrderedBy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to access then type. + /// + public static string AccessThenType { + get { + return ResourceManager.GetString("AccessThenType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add space inside self closing tags. + /// + public static string AddSpaceInsideSelfClosingTags { + get { + return ResourceManager.GetString("AddSpaceInsideSelfClosingTags", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add spacing around XML tags. + /// + public static string AddSpacingAroundXMLTags { + get { + return ResourceManager.GetString("AddSpacingAroundXMLTags", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to after attributes. + /// + public static string AfterAttributes { + get { + return ResourceManager.GetString("AfterAttributes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to after opening braces. + /// + public static string AfterOpeningBraces { + get { + return ResourceManager.GetString("AfterOpeningBraces", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Alert threshold. + /// + public static string AlertThreshold { + get { + return ResourceManager.GetString("AlertThreshold", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Align XML &lt;param&gt; tags. + /// + public static string AlignXMLLtParamGtTags { + get { + return ResourceManager.GetString("AlignXMLLtParamGtTags", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to all. + /// + public static string All { + get { + return ResourceManager.GetString("All", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to alphabetical. + /// + public static string Alphabetical { + get { + return ResourceManager.GetString("Alphabetical", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Alphabetize members of the same group. + /// + public static string AlphabetizeMembersOfTheSameGroup { + get { + return ResourceManager.GetString("AlphabetizeMembersOfTheSameGroup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Always split all XML tags onto multiple lines. + /// + public static string AlwaysSplitAllXMLTagsOntoMultipleLines { + get { + return ResourceManager.GetString("AlwaysSplitAllXMLTagsOntoMultipleLines", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Always split &lt;summary&gt; tags onto multiple lines. + /// + public static string AlwaysSplitLtSummaryGtTagsOntoMultipleLines { + get { + return ResourceManager.GetString("AlwaysSplitLtSummaryGtTagsOntoMultipleLines", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you ready for CodeMaid to clean everything in the solution?. + /// + public static string AreYouReadyForCodeMaidToCleanEverythingInTheSolution { + get { + return ResourceManager.GetString("AreYouReadyForCodeMaidToCleanEverythingInTheSolution", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want all . + /// + public static string AreYouSureYouWantAll { + get { + return ResourceManager.GetString("AreYouSureYouWantAll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ask. + /// + public static string Ask { + get { + return ResourceManager.GetString("Ask", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to at bottom of file. + /// + public static string AtBottomOfFile { + get { + return ResourceManager.GetString("AtBottomOfFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to at top of file. + /// + public static string AtTopOfFile { + get { + return ResourceManager.GetString("AtTopOfFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to auto-detect. + /// + public static string AutoDetect { + get { + return ResourceManager.GetString("AutoDetect", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Automatic. + /// + public static string Automatic { + get { + return ResourceManager.GetString("Automatic", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Automatically run cleanup on file save. + /// + public static string AutomaticallyRunCleanupOnFileSave { + get { + return ResourceManager.GetString("AutomaticallyRunCleanupOnFileSave", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Automatically save and close documents opened by cleanup. + /// + public static string AutomaticallySaveAndCloseDocumentsOpenedByCleanup { + get { + return ResourceManager.GetString("AutomaticallySaveAndCloseDocumentsOpenedByCleanup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Automatic Cleanup On Save - . + /// + public static string AutomaticCleanupOnSave { + get { + return ResourceManager.GetString("AutomaticCleanupOnSave", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Batch . + /// + public static string Batch { + get { + return ResourceManager.GetString("Batch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to before closing angle brackets. + /// + public static string BeforeClosingAngleBrackets { + get { + return ResourceManager.GetString("BeforeClosingAngleBrackets", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to before closing braces. + /// + public static string BeforeClosingBraces { + get { + return ResourceManager.GetString("BeforeClosingBraces", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to before closing tags. + /// + public static string BeforeClosingTags { + get { + return ResourceManager.GetString("BeforeClosingTags", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to between chained statements. + /// + public static string BetweenChainedStatements { + get { + return ResourceManager.GetString("BetweenChainedStatements", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Building. + /// + public static string Building { + get { + return ResourceManager.GetString("Building", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Build Progress. + /// + public static string BuildProgress { + get { + return ResourceManager.GetString("BuildProgress", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Build progress window. + /// + public static string BuildProgressWindow { + get { + return ResourceManager.GetString("BuildProgressWindow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cache file code models. + /// + public static string CacheFileCodeModels { + get { + return ResourceManager.GetString("CacheFileCodeModels", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cancel. + /// + public static string Cancel { + get { + return ResourceManager.GetString("Cancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Canceling.... + /// + public static string Canceling { + get { + return ResourceManager.GetString("Canceling", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cleaning. + /// + public static string Cleaning { + get { + return ResourceManager.GetString("Cleaning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cleaning. + /// + public static string Cleaning_n { + get { + return ResourceManager.GetString("Cleaning_n", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File Types. + /// + public static string CleaningFileTypesViewModel_FileTypes { + get { + return ResourceManager.GetString("CleaningFileTypesViewModel_FileTypes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update. + /// + public static string CleaningUpdateViewModel_Update { + get { + return ResourceManager.GetString("CleaningUpdateViewModel_Update", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cleanup. + /// + public static string Cleanup { + get { + return ResourceManager.GetString("Cleanup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cleanup Active Code. + /// + public static string CleanupActiveCode { + get { + return ResourceManager.GetString("CleanupActiveCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cleanup Active Document. + /// + public static string CleanupActiveDocument { + get { + return ResourceManager.GetString("CleanupActiveDocument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cleanup All Code. + /// + public static string CleanupAllCode { + get { + return ResourceManager.GetString("CleanupAllCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cleanup cannot run while debugging.. + /// + public static string CleanupCannotRunWhileDebugging { + get { + return ResourceManager.GetString("CleanupCannotRunWhileDebugging", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cleanup Open Code. + /// + public static string CleanupOpenCode { + get { + return ResourceManager.GetString("CleanupOpenCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cleanup Selected Code. + /// + public static string CleanupSelectedCode { + get { + return ResourceManager.GetString("CleanupSelectedCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Clear Solution Explorer search filtering to find filtered items. + /// + public static string ClearSolutionExplorerSearchFilteringToFindFilteredItems { + get { + return ResourceManager.GetString("ClearSolutionExplorerSearchFilteringToFindFilteredItems", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Close. + /// + public static string Close { + get { + return ResourceManager.GetString("Close", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Close All Read-Only. + /// + public static string CloseAllReadOnly { + get { + return ResourceManager.GetString("CloseAllReadOnly", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid cleaned '{0}'.. + /// + public static string CodeMaidCleaned0 { + get { + return ResourceManager.GetString("CodeMaidCleaned0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid: Cleanup All Code. + /// + public static string CodeMaidCleanupAllCode { + get { + return ResourceManager.GetString("CodeMaidCleanupAllCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid: Cleanup External File. + /// + public static string CodeMaidCleanupExternalFile { + get { + return ResourceManager.GetString("CodeMaidCleanupExternalFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Cleanup for '{0}'. + /// + public static string CodeMaidCleanupFor0 { + get { + return ResourceManager.GetString("CodeMaidCleanupFor0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid: Cleanup Progress. + /// + public static string CodeMaidCleanupProgress { + get { + return ResourceManager.GetString("CodeMaidCleanupProgress", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid: Confirmation for Cleanup All Code. + /// + public static string CodeMaidConfirmationForCleanupAllCode { + get { + return ResourceManager.GetString("CodeMaidConfirmationForCleanupAllCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid: Confirmation for Reset . + /// + public static string CodeMaidConfirmationForReset { + get { + return ResourceManager.GetString("CodeMaidConfirmationForReset", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid: Confirmation to Save Pending Changes. + /// + public static string CodeMaidConfirmationToSavePendingChanges { + get { + return ResourceManager.GetString("CodeMaidConfirmationToSavePendingChanges", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Delete Items. + /// + public static string CodeMaidDeleteItems { + get { + return ResourceManager.GetString("CodeMaidDeleteItems", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid did not find a non-code comment {0} to reformat.. + /// + public static string CodeMaidDidNotFindANonCodeComment0ToReformat { + get { + return ResourceManager.GetString("CodeMaidDidNotFindANonCodeComment0ToReformat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid: Export . + /// + public static string CodeMaidExport { + get { + return ResourceManager.GetString("CodeMaidExport", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid failed to load theme '{0}'. See output window for more details.. + /// + public static string CodeMaidFailedToLoadTheme0SeeOutputWindowForMoreDetails { + get { + return ResourceManager.GetString("CodeMaidFailedToLoadTheme0SeeOutputWindowForMoreDetails", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid finished formatting the comment.. + /// + public static string CodeMaidFinishedFormattingTheComment { + get { + return ResourceManager.GetString("CodeMaidFinishedFormattingTheComment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid finished formatting the comments {0}.. + /// + public static string CodeMaidFinishedFormattingTheComments0 { + get { + return ResourceManager.GetString("CodeMaidFinishedFormattingTheComments0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Format Comment. + /// + public static string CodeMaidFormatComment { + get { + return ResourceManager.GetString("CodeMaidFormatComment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid has successfully exported . + /// + public static string CodeMaidHasSuccessfullyExported { + get { + return ResourceManager.GetString("CodeMaidHasSuccessfullyExported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid has successfully imported {1} from '{0}'.. + /// + public static string CodeMaidHasSuccessfullyImported1From0 { + get { + return ResourceManager.GetString("CodeMaidHasSuccessfullyImported1From0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid has successfully reset . + /// + public static string CodeMaidHasSuccessfullyReset { + get { + return ResourceManager.GetString("CodeMaidHasSuccessfullyReset", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid: Import . + /// + public static string CodeMaidImport { + get { + return ResourceManager.GetString("CodeMaidImport", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Insert Region. + /// + public static string CodeMaidInsertRegion { + get { + return ResourceManager.GetString("CodeMaidInsertRegion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid is cleaning '{0}'.... + /// + public static string CodeMaidIsCleaning0 { + get { + return ResourceManager.GetString("CodeMaidIsCleaning0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Join. + /// + public static string CodeMaidJoin { + get { + return ResourceManager.GetString("CodeMaidJoin", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Move Item Above. + /// + public static string CodeMaidMoveItemAbove { + get { + return ResourceManager.GetString("CodeMaidMoveItemAbove", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Move Item Below. + /// + public static string CodeMaidMoveItemBelow { + get { + return ResourceManager.GetString("CodeMaidMoveItemBelow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Move Item Into. + /// + public static string CodeMaidMoveItemInto { + get { + return ResourceManager.GetString("CodeMaidMoveItemInto", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Options. + /// + public static string CodeMaidOptions { + get { + return ResourceManager.GetString("CodeMaidOptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Remove All Regions. + /// + public static string CodeMaidRemoveAllRegions { + get { + return ResourceManager.GetString("CodeMaidRemoveAllRegions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Remove Region . + /// + public static string CodeMaidRemoveRegion { + get { + return ResourceManager.GetString("CodeMaidRemoveRegion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Remove Regions. + /// + public static string CodeMaidRemoveRegions { + get { + return ResourceManager.GetString("CodeMaidRemoveRegions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Remove Selected Regions. + /// + public static string CodeMaidRemoveSelectedRegions { + get { + return ResourceManager.GetString("CodeMaidRemoveSelectedRegions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid reorganized '{0}'.. + /// + public static string CodeMaidReorganized0 { + get { + return ResourceManager.GetString("CodeMaidReorganized0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Reorganize for '{0}'. + /// + public static string CodeMaidReorganizeFor0 { + get { + return ResourceManager.GetString("CodeMaidReorganizeFor0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid: Reorganize Preprocessor Conditionals. + /// + public static string CodeMaidReorganizePreprocessorConditionals { + get { + return ResourceManager.GetString("CodeMaidReorganizePreprocessorConditionals", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid: Reset . + /// + public static string CodeMaidReset { + get { + return ResourceManager.GetString("CodeMaidReset", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Sort. + /// + public static string CodeMaidSort { + get { + return ResourceManager.GetString("CodeMaidSort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid Spade. + /// + public static string CodeMaidSpade { + get { + return ResourceManager.GetString("CodeMaidSpade", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid turned automatic cleanup on save. + /// + public static string CodeMaidTurnedAutomaticCleanupOnSave { + get { + return ResourceManager.GetString("CodeMaidTurnedAutomaticCleanupOnSave", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid was unable to export . + /// + public static string CodeMaidWasUnableToExport { + get { + return ResourceManager.GetString("CodeMaidWasUnableToExport", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid was unable to import . + /// + public static string CodeMaidWasUnableToImport { + get { + return ResourceManager.GetString("CodeMaidWasUnableToImport", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid was unable to reset . + /// + public static string CodeMaidWasUnableToReset { + get { + return ResourceManager.GetString("CodeMaidWasUnableToReset", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Collapse All Solution Explorer. + /// + public static string CollapseAllSolutionExplorer { + get { + return ResourceManager.GetString("CollapseAllSolutionExplorer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Collapse Selected Solution Explorer. + /// + public static string CollapseSelectedSolutionExplorer { + get { + return ResourceManager.GetString("CollapseSelectedSolutionExplorer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Collapse solutions when they are opened. + /// + public static string CollapseSolutionsWhenTheyAreOpened { + get { + return ResourceManager.GetString("CollapseSolutionsWhenTheyAreOpened", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Collapsing. + /// + public static string CollapsingViewModel_Collapsing { + get { + return ResourceManager.GetString("CollapsingViewModel_Collapsing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complexity. + /// + public static string Complexity { + get { + return ResourceManager.GetString("Complexity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Conditions. + /// + public static string Conditions { + get { + return ResourceManager.GetString("Conditions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Config files (*.config)|*.config|All Files (*.*)|*.*. + /// + public static string ConfigFilesConfigConfigAllFiles { + get { + return ResourceManager.GetString("ConfigFilesConfigConfigAllFiles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} contains preprocessor conditionals (e.g. #if, #pragma) which reorganization does not currently support.\r\n\r\nDo you want to reorganize anyways (DANGEROUS)?. + /// + public static string ContainsPreprocessorConditionalsEGIfPragmaWhichReorganizationDoesNotCurrentlySupportRNRNDoYouWantToReorganizeAnywaysDANGEROUS { + get { + return ResourceManager.GetString("ContainsPreprocessorConditionalsEGIfPragmaWhichReorganizationDoesNotCurrentlySupp" + + "ortRNRNDoYouWantToReorganizeAnywaysDANGEROUS", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to dark. + /// + public static string Dark { + get { + return ResourceManager.GetString("Dark", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deploying. + /// + public static string Deploying { + get { + return ResourceManager.GetString("Deploying", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Diagnostic. + /// + public static string Diagnostic { + get { + return ResourceManager.GetString("Diagnostic", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Diagnostics. + /// + public static string Diagnostics { + get { + return ResourceManager.GetString("Diagnostics", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Diagnostics mode. + /// + public static string DiagnosticsMode { + get { + return ResourceManager.GetString("DiagnosticsMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Digging. + /// + public static string Digging { + get { + return ResourceManager.GetString("Digging", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Digging (Spade). + /// + public static string DiggingViewModel_DiggingSpade { + get { + return ResourceManager.GetString("DiggingViewModel_DiggingSpade", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Display. + /// + public static string Display { + get { + return ResourceManager.GetString("Display", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Do you want to perform a partial cleanup?. + /// + public static string DoYouWantToPerformAPartialCleanup { + get { + return ResourceManager.GetString("DoYouWantToPerformAPartialCleanup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drag to reorder, drag over to group, right click to split, double-click to rename. + /// + public static string DragToReorderDragOverToGroupRightClickToSplitDoubleClickToRename { + get { + return ResourceManager.GetString("DragToReorderDragOverToGroupRightClickToSplitDoubleClickToRename", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to empty. + /// + public static string Empty { + get { + return ResourceManager.GetString("Empty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Everything else (ex: .txt, README). + /// + public static string EverythingElseExTxtREADME { + get { + return ResourceManager.GetString("EverythingElseExTxtREADME", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exclude. + /// + public static string Exclude { + get { + return ResourceManager.GetString("Exclude", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ex: #endregion Methods. + /// + public static string ExEndregionMethods { + get { + return ResourceManager.GetString("ExEndregionMethods", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Export. + /// + public static string Export { + get { + return ResourceManager.GetString("Export", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ex: #region Public Methods, #region Private Methods. + /// + public static string ExRegionPublicMethodsRegionPrivateMethods { + get { + return ResourceManager.GetString("ExRegionPublicMethodsRegionPrivateMethods", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to External. + /// + public static string External { + get { + return ResourceManager.GetString("External", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Extra indent for values inside XML comments. + /// + public static string ExtraIndentForValuesInsideXMLComments { + get { + return ResourceManager.GetString("ExtraIndentForValuesInsideXMLComments", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Automatic Cleanup On Save. + /// + public static string FeaturesDataTemplate_AutomaticCleanupOnSave { + get { + return ResourceManager.GetString("FeaturesDataTemplate_AutomaticCleanupOnSave", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Features Switch. + /// + public static string FeaturesSwitch { + get { + return ResourceManager.GetString("FeaturesSwitch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Features. + /// + public static string FeaturesViewModel_Features { + get { + return ResourceManager.GetString("FeaturesViewModel_Features", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File Header. + /// + public static string FileHeader { + get { + return ResourceManager.GetString("FileHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to file order. + /// + public static string FileOrder { + get { + return ResourceManager.GetString("FileOrder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Finding. + /// + public static string FindingViewModel_Finding { + get { + return ResourceManager.GetString("FindingViewModel_Finding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Find In Solution Explorer. + /// + public static string FindInSolutionExplorer { + get { + return ResourceManager.GetString("FindInSolutionExplorer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Font. + /// + public static string Font { + get { + return ResourceManager.GetString("Font", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Format Comment. + /// + public static string FormatComment { + get { + return ResourceManager.GetString("FormatComment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Formatting. + /// + public static string FormattingViewModel_Formatting { + get { + return ResourceManager.GetString("FormattingViewModel_Formatting", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to General. + /// + public static string General { + get { + return ResourceManager.GetString("General", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Handled Exception. + /// + public static string HandledException { + get { + return ResourceManager.GetString("HandledException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hide build progress window when a build stops. + /// + public static string HideBuildProgressWindowWhenABuildStops { + get { + return ResourceManager.GetString("HideBuildProgressWindowWhenABuildStops", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Icons. + /// + public static string Icons { + get { + return ResourceManager.GetString("Icons", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If there is only one project in a solution, keep it expanded but still collapse its children. + /// + public static string IfThereIsOnlyOneProjectInASolutionKeepItExpandedButStillCollapseItsChildren { + get { + return ResourceManager.GetString("IfThereIsOnlyOneProjectInASolutionKeepItExpandedButStillCollapseItsChildren", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Import. + /// + public static string Import { + get { + return ResourceManager.GetString("Import", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Include. + /// + public static string Include { + get { + return ResourceManager.GetString("Include", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Include access level in regions. + /// + public static string IncludeAccessLevelInRegions { + get { + return ResourceManager.GetString("IncludeAccessLevelInRegions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Indentation margin. + /// + public static string IndentationMargin { + get { + return ResourceManager.GetString("IndentationMargin", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insert. + /// + public static string Insert { + get { + return ResourceManager.GetString("Insert", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insert blank line padding after. + /// + public static string InsertBlankLinePaddingAfter { + get { + return ResourceManager.GetString("InsertBlankLinePaddingAfter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insert blank line padding before. + /// + public static string InsertBlankLinePaddingBefore { + get { + return ResourceManager.GetString("InsertBlankLinePaddingBefore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insert blank line padding between. + /// + public static string InsertBlankLinePaddingBetween { + get { + return ResourceManager.GetString("InsertBlankLinePaddingBetween", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insert blank space before. + /// + public static string InsertBlankSpaceBefore { + get { + return ResourceManager.GetString("InsertBlankSpaceBefore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insert end of file trailing new line. + /// + public static string InsertEndOfFileTrailingNewLine { + get { + return ResourceManager.GetString("InsertEndOfFileTrailingNewLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insert explicit access modifiers on. + /// + public static string InsertExplicitAccessModifiersOn { + get { + return ResourceManager.GetString("InsertExplicitAccessModifiersOn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insert/keep regions even if they are empty. + /// + public static string InsertKeepRegionsEvenIfTheyAreEmpty { + get { + return ResourceManager.GetString("InsertKeepRegionsEvenIfTheyAreEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insert new regions. + /// + public static string InsertNewRegions { + get { + return ResourceManager.GetString("InsertNewRegions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to in the selection. + /// + public static string InTheSelection { + get { + return ResourceManager.GetString("InTheSelection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to is not in the solution so some cleanup actions may be unavailable.. + /// + public static string IsNotInTheSolutionSoSomeCleanupActionsMayBeUnavailable { + get { + return ResourceManager.GetString("IsNotInTheSolutionSoSomeCleanupActionsMayBeUnavailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Join Lines. + /// + public static string JoinLines { + get { + return ResourceManager.GetString("JoinLines", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Keep members within regions. + /// + public static string KeepMembersWithinRegions { + get { + return ResourceManager.GetString("KeepMembersWithinRegions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Keep XML tags together. + /// + public static string KeepXMLTagsTogether { + get { + return ResourceManager.GetString("KeepXMLTagsTogether", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to light. + /// + public static string Light { + get { + return ResourceManager.GetString("Light", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to loading.... + /// + public static string Loading { + get { + return ResourceManager.GetString("Loading", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Load models asynchronously. + /// + public static string LoadModelsAsynchronously { + get { + return ResourceManager.GetString("LoadModelsAsynchronously", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Member type order, grouping and preferred names. + /// + public static string MemberTypeOrderGroupingAndPreferredNames { + get { + return ResourceManager.GetString("MemberTypeOrderGroupingAndPreferredNames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Metadata. + /// + public static string Metadata { + get { + return ResourceManager.GetString("Metadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Miscellaneous. + /// + public static string Miscellaneous { + get { + return ResourceManager.GetString("Miscellaneous", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Most Complex. + /// + public static string MostComplex { + get { + return ResourceManager.GetString("MostComplex", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to name only. + /// + public static string NameOnly { + get { + return ResourceManager.GetString("NameOnly", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Namespace. + /// + public static string Namespace { + get { + return ResourceManager.GetString("Namespace", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Navigation. + /// + public static string Navigation { + get { + return ResourceManager.GetString("Navigation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Region. + /// + public static string NewRegion { + get { + return ResourceManager.GetString("NewRegion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to no. + /// + public static string No { + get { + return ResourceManager.GetString("No", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to none. + /// + public static string None { + get { + return ResourceManager.GetString("None", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to to be reset to their defaults?. + /// + public static string OptionsViewModel_OnResetToDefaultsCommandExecuted_ToBeResetToTheirDefaults { + get { + return ResourceManager.GetString("OptionsViewModel_OnResetToDefaultsCommandExecuted_ToBeResetToTheirDefaults", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Other. + /// + public static string Other { + get { + return ResourceManager.GetString("Other", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Other cleaning commands (ex: ReSharper.ReSharper_SilentCleanupCode). + /// + public static string OtherCleaningCommandsExReSharperReSharper_SilentCleanupCode { + get { + return ResourceManager.GetString("OtherCleaningCommandsExReSharperReSharper_SilentCleanupCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Performance. + /// + public static string Performance { + get { + return ResourceManager.GetString("Performance", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Perform partial cleanup if file is not in the solution. + /// + public static string PerformPartialCleanupIfFileIsNotInTheSolution { + get { + return ResourceManager.GetString("PerformPartialCleanupIfFileIsNotInTheSolution", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Perform reorganization when preprocessor conditionals are present. + /// + public static string PerformReorganizationWhenPreprocessorConditionalsArePresent { + get { + return ResourceManager.GetString("PerformReorganizationWhenPreprocessorConditionalsArePresent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Place each command on a separate line. + /// + public static string PlaceEachCommandOnASeparateLine { + get { + return ResourceManager.GetString("PlaceEachCommandOnASeparateLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Place each regular expression on a separate line. + /// + public static string PlaceEachRegularExpressionOnASeparateLine { + get { + return ResourceManager.GetString("PlaceEachRegularExpressionOnASeparateLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Place each set on a separate line. + /// + public static string PlaceEachSetOnASeparateLine { + get { + return ResourceManager.GetString("PlaceEachSetOnASeparateLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Place each using statement on a separate line. + /// + public static string PlaceEachUsingStatementOnASeparateLine { + get { + return ResourceManager.GetString("PlaceEachUsingStatementOnASeparateLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Place explicit interface members at the end of their group. + /// + public static string PlaceExplicitInterfaceMembersAtTheEndOfTheirGroup { + get { + return ResourceManager.GetString("PlaceExplicitInterfaceMembersAtTheEndOfTheirGroup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preview (reopen to refresh). + /// + public static string PreviewReopenToRefresh { + get { + return ResourceManager.GetString("PreviewReopenToRefresh", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Primary ordering should be by. + /// + public static string PrimaryOrderingShouldBeBy { + get { + return ResourceManager.GetString("PrimaryOrderingShouldBeBy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Primary sort should be by. + /// + public static string PrimarySortShouldBeBy { + get { + return ResourceManager.GetString("PrimarySortShouldBeBy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Progressing. + /// + public static string ProgressingViewModel_Progressing { + get { + return ResourceManager.GetString("ProgressingViewModel_Progressing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Read-Only. + /// + public static string ReadOnly { + get { + return ResourceManager.GetString("ReadOnly", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Read-Only Toggle. + /// + public static string ReadOnlyToggle { + get { + return ResourceManager.GetString("ReadOnlyToggle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Rebuilding. + /// + public static string Rebuilding { + get { + return ResourceManager.GetString("Rebuilding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to refreshing.... + /// + public static string Refreshing { + get { + return ResourceManager.GetString("Refreshing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Regions. + /// + public static string Regions { + get { + return ResourceManager.GetString("Regions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Regular expressions that match path names to exclude (ex: \.resx$ or \\lib\\ ). + /// + public static string RegularExpressionsThatMatchPathNamesToExcludeExResxOrLib { + get { + return ResourceManager.GetString("RegularExpressionsThatMatchPathNamesToExcludeExResxOrLib", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove. + /// + public static string Remove { + get { + return ResourceManager.GetString("Remove", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Remove All Regions. + /// + public static string RemoveAllRegions { + get { + return ResourceManager.GetString("RemoveAllRegions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove blank lines. + /// + public static string RemoveBlankLines { + get { + return ResourceManager.GetString("RemoveBlankLines", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove blank spaces. + /// + public static string RemoveBlankSpaces { + get { + return ResourceManager.GetString("RemoveBlankSpaces", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Remove Current Region. + /// + public static string RemoveCurrentRegion { + get { + return ResourceManager.GetString("RemoveCurrentRegion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove end of file trailing new line. + /// + public static string RemoveEndOfFileTrailingNewLine { + get { + return ResourceManager.GetString("RemoveEndOfFileTrailingNewLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove end of line whitespace. + /// + public static string RemoveEndOfLineWhitespace { + get { + return ResourceManager.GetString("RemoveEndOfLineWhitespace", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove existing regions. + /// + public static string RemoveExistingRegions { + get { + return ResourceManager.GetString("RemoveExistingRegions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove multiple consecutive blank lines. + /// + public static string RemoveMultipleConsecutiveBlankLines { + get { + return ResourceManager.GetString("RemoveMultipleConsecutiveBlankLines", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove Region. + /// + public static string RemoveRegion { + get { + return ResourceManager.GetString("RemoveRegion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove regions. + /// + public static string RemoveRegions { + get { + return ResourceManager.GetString("RemoveRegions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Remove Selected Regions. + /// + public static string RemoveSelectedRegions { + get { + return ResourceManager.GetString("RemoveSelectedRegions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CodeMaid is reorganizing '{0}'.... + /// + public static string Reorganize_CodeMaidIsReorganizing0 { + get { + return ResourceManager.GetString("Reorganize_CodeMaidIsReorganizing0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reorganize Active Code. + /// + public static string ReorganizeActiveCode { + get { + return ResourceManager.GetString("ReorganizeActiveCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reorganize Active Document. + /// + public static string ReorganizeActiveDocument { + get { + return ResourceManager.GetString("ReorganizeActiveDocument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reorganizing. + /// + public static string Reorganizing { + get { + return ResourceManager.GetString("Reorganizing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Types. + /// + public static string ReorganizingTypesViewModel_Types { + get { + return ResourceManager.GetString("ReorganizingTypesViewModel_Types", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reset to Defaults. + /// + public static string ResetToDefaults { + get { + return ResourceManager.GetString("ResetToDefaults", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run format comments during cleanup. + /// + public static string RunFormatCommentsDuringCleanup { + get { + return ResourceManager.GetString("RunFormatCommentsDuringCleanup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run format document. + /// + public static string RunFormatDocument { + get { + return ResourceManager.GetString("RunFormatDocument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run JetBrains ReSharper cleanup. + /// + public static string RunJetBrainsReSharperCleanup { + get { + return ResourceManager.GetString("RunJetBrainsReSharperCleanup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run remove and sort using statements. + /// + public static string RunRemoveAndSortUsingStatements { + get { + return ResourceManager.GetString("RunRemoveAndSortUsingStatements", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run reorganize at start of cleanup. + /// + public static string RunReorganizeAtStartOfCleanup { + get { + return ResourceManager.GetString("RunReorganizeAtStartOfCleanup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run Telerik JustCode cleanup. + /// + public static string RunTelerikJustCodeCleanup { + get { + return ResourceManager.GetString("RunTelerikJustCodeCleanup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Run XAML Styler cleanup. + /// + public static string RunXAMLStylerCleanup { + get { + return ResourceManager.GetString("RunXAMLStylerCleanup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Save. + /// + public static string Save { + get { + return ResourceManager.GetString("Save", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Search CodeMaid Spade (Ctrl+M, ;). + /// + public static string SearchCodeMaidSpadeCtrlM { + get { + return ResourceManager.GetString("SearchCodeMaidSpadeCtrlM", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to . See output window for more details.. + /// + public static string SeeOutputWindowForMoreDetails { + get { + return ResourceManager.GetString("SeeOutputWindowForMoreDetails", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Select a sub-category to set options.. + /// + public static string SelectASubCategoryToSetOptions { + get { + return ResourceManager.GetString("SelectASubCategoryToSetOptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sets of related file extensions (ex: .cpp .h ). + /// + public static string SetsOfRelatedFileExtensionsExCppH { + get { + return ResourceManager.GetString("SetsOfRelatedFileExtensionsExCppH", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OFF. + /// + public static string SettingCleanupOnSaveCommand_OFF { + get { + return ResourceManager.GetString("SettingCleanupOnSaveCommand_OFF", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ON. + /// + public static string SettingCleanupOnSaveCommand_ON { + get { + return ResourceManager.GetString("SettingCleanupOnSaveCommand_ON", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show build progress on Visual Studio icon in Windows taskbar. + /// + public static string ShowBuildProgressOnVisualStudioIconInWindowsTaskbar { + get { + return ResourceManager.GetString("ShowBuildProgressOnVisualStudioIconInWindowsTaskbar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show build progress window when a build starts. + /// + public static string ShowBuildProgressWindowWhenABuildStarts { + get { + return ResourceManager.GetString("ShowBuildProgressWindowWhenABuildStarts", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show item complexity (McCabe). + /// + public static string ShowItemComplexityMcCabe { + get { + return ResourceManager.GetString("ShowItemComplexityMcCabe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show item metadata. + /// + public static string ShowItemMetadata { + get { + return ResourceManager.GetString("ShowItemMetadata", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show method parameters. + /// + public static string ShowMethodParameters { + get { + return ResourceManager.GetString("ShowMethodParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show start page when a solution is closed. + /// + public static string ShowStartPageWhenASolutionIsClosed { + get { + return ResourceManager.GetString("ShowStartPageWhenASolutionIsClosed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Skip during automatic cleanup on save. + /// + public static string SkipDuringAutomaticCleanupOnSave { + get { + return ResourceManager.GetString("SkipDuringAutomaticCleanupOnSave", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Skip wrapping on the last word. + /// + public static string SkipWrappingOnTheLastWord { + get { + return ResourceManager.GetString("SkipWrappingOnTheLastWord", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Solution Explorer. + /// + public static string SolutionExplorer { + get { + return ResourceManager.GetString("SolutionExplorer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Solution-Specific Settings. + /// + public static string SolutionSpecificSettings { + get { + return ResourceManager.GetString("SolutionSpecificSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sort. + /// + public static string Sort { + get { + return ResourceManager.GetString("Sort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Sort Lines. + /// + public static string SortLines { + get { + return ResourceManager.GetString("SortLines", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Spade. + /// + public static string Spade { + get { + return ResourceManager.GetString("Spade", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Spade Tool Window. + /// + public static string SpadeToolWindow { + get { + return ResourceManager.GetString("SpadeToolWindow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Split. + /// + public static string Split { + get { + return ResourceManager.GetString("Split", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successful. + /// + public static string Successful { + get { + return ResourceManager.GetString("Successful", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to S&witch File. + /// + public static string SWitchFile { + get { + return ResourceManager.GetString("SWitchFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Switch File. + /// + public static string SwitchFile_no_alt { + get { + return ResourceManager.GetString("SwitchFile_no_alt", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Switching. + /// + public static string SwitchingViewModel_Switching { + get { + return ResourceManager.GetString("SwitchingViewModel_Switching", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to S&witch to . + /// + public static string SWitchTo { + get { + return ResourceManager.GetString("SWitchTo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Synchronize outlining with the code file. + /// + public static string SynchronizeOutliningWithTheCodeFile { + get { + return ResourceManager.GetString("SynchronizeOutliningWithTheCodeFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to T4 generated code. + /// + public static string T4GeneratedCode { + get { + return ResourceManager.GetString("T4GeneratedCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Temporarily open solution folders to find nested items. + /// + public static string TemporarilyOpenSolutionFoldersToFindNestedItems { + get { + return ResourceManager.GetString("TemporarilyOpenSolutionFoldersToFindNestedItems", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Theme. + /// + public static string Theme { + get { + return ResourceManager.GetString("Theme", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Third Party. + /// + public static string ThirdPartyViewModel_ThirdParty { + get { + return ResourceManager.GetString("ThirdPartyViewModel_ThirdParty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This action cannot be undone.. + /// + public static string ThisActionCannotBeUndone { + get { + return ResourceManager.GetString("ThisActionCannotBeUndone", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to to '{0}'.. + /// + public static string To0 { + get { + return ResourceManager.GetString("To0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tool Windows. + /// + public static string ToolWindows { + get { + return ResourceManager.GetString("ToolWindows", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to type. + /// + public static string Type { + get { + return ResourceManager.GetString("Type", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to type then access. + /// + public static string TypeThenAccess { + get { + return ResourceManager.GetString("TypeThenAccess", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to export . + /// + public static string UnableToExport { + get { + return ResourceManager.GetString("UnableToExport", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to reset . + /// + public static string UnableToReset { + get { + return ResourceManager.GetString("UnableToReset", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to toggle read only state on . + /// + public static string UnableToToggleReadOnlyStateOn { + get { + return ResourceManager.GetString("UnableToToggleReadOnlyStateOn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to under the cursor. + /// + public static string UnderTheCursor { + get { + return ResourceManager.GetString("UnderTheCursor", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unsuccessful. + /// + public static string Unsuccessful { + get { + return ResourceManager.GetString("Unsuccessful", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update accessors to both be single-line or multi-line (SA1504). + /// + public static string UpdateAccessorsToBothBeSingleLineOrMultiLineSA1504 { + get { + return ResourceManager.GetString("UpdateAccessorsToBothBeSingleLineOrMultiLineSA1504", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update #endregion tags with region name. + /// + public static string UpdateEndregionTagsWithRegionName { + get { + return ResourceManager.GetString("UpdateEndregionTagsWithRegionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update single line methods by placing braces on separate lines (SA1502). + /// + public static string UpdateSingleLineMethodsByPlacingBracesOnSeparateLinesSA1502 { + get { + return ResourceManager.GetString("UpdateSingleLineMethodsByPlacingBracesOnSeparateLinesSA1502", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User Settings. + /// + public static string UserSettings { + get { + return ResourceManager.GetString("UserSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Use undo transactions. + /// + public static string UseUndoTransactions { + get { + return ResourceManager.GetString("UseUndoTransactions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Using statements to re-insert when removed (ex: using System; ). + /// + public static string UsingStatementsToReInsertWhenRemovedExUsingSystem { + get { + return ResourceManager.GetString("UsingStatementsToReInsertWhenRemovedExUsingSystem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Visuals. + /// + public static string Visuals { + get { + return ResourceManager.GetString("Visuals", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Warning. + /// + public static string Warning { + get { + return ResourceManager.GetString("Warning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Warning threshold. + /// + public static string WarningThreshold { + get { + return ResourceManager.GetString("WarningThreshold", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to was stopped. + /// + public static string WasStopped { + get { + return ResourceManager.GetString("WasStopped", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When navigating center on. + /// + public static string WhenNavigatingCenterOn { + get { + return ResourceManager.GetString("WhenNavigatingCenterOn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to When sorting by type, secondary sort should be by. + /// + public static string WhenSortingByTypeSecondarySortShouldBeBy { + get { + return ResourceManager.GetString("WhenSortingByTypeSecondarySortShouldBeBy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to While Cleaning. + /// + public static string WhileCleaning { + get { + return ResourceManager.GetString("WhileCleaning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Whitespace. + /// + public static string Whitespace { + get { + return ResourceManager.GetString("Whitespace", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to whole item. + /// + public static string WholeItem { + get { + return ResourceManager.GetString("WholeItem", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Windows taskbar. + /// + public static string WindowsTaskbar { + get { + return ResourceManager.GetString("WindowsTaskbar", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Wrap comments at column. + /// + public static string WrapCommentsAtColumn { + get { + return ResourceManager.GetString("WrapCommentsAtColumn", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to yes. + /// + public static string Yes { + get { + return ResourceManager.GetString("Yes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You have pending changes. Do you want to save them before continuing?. + /// + public static string YouHavePendingChangesDoYouWantToSaveThemBeforeContinuing { + get { + return ResourceManager.GetString("YouHavePendingChangesDoYouWantToSaveThemBeforeContinuing", resourceCulture); + } + } + } +} diff --git a/CodeMaid/Properties/Resources.en-US.resx b/CodeMaid/Properties/Resources.en-US.resx new file mode 100644 index 00000000..c51b4215 --- /dev/null +++ b/CodeMaid/Properties/Resources.en-US.resx @@ -0,0 +1,924 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Unable to import + + + Access levels should be ordered by + + + access then type + + + Add space inside self closing tags + + + Add spacing around XML tags + + + after attributes + + + after opening braces + + + Alert threshold + + + Align XML &lt;param&gt; tags + + + all + + + alphabetical + + + Alphabetize members of the same group + + + Always split all XML tags onto multiple lines + + + Always split &lt;summary&gt; tags onto multiple lines + + + Are you ready for CodeMaid to clean everything in the solution? + + + Are you sure you want all + + + ask + + + at bottom of file + + + at top of file + + + auto-detect + + + Automatic + + + Automatically run cleanup on file save + + + Automatically save and close documents opened by cleanup + + + Automatic Cleanup On Save - + + + Batch + + + before closing angle brackets + + + before closing braces + + + before closing tags + + + between chained statements + + + Building + + + Build Progress + + + Build progress window + + + Cache file code models + + + Cancel + + + Canceling... + + + Cleaning + + + Cleaning + + + File Types + + + Update + + + Cleanup + + + Cleanup Active Code + + + Cleanup Active Document + + + Cleanup All Code + + + Cleanup cannot run while debugging. + + + Cleanup Open Code + + + Cleanup Selected Code + + + Clear Solution Explorer search filtering to find filtered items + + + Close + + + Close All Read-Only + + + CodeMaid cleaned '{0}'. + + + CodeMaid: Cleanup All Code + + + CodeMaid: Cleanup External File + + + CodeMaid Cleanup for '{0}' + + + CodeMaid: Cleanup Progress + + + CodeMaid: Confirmation for Cleanup All Code + + + CodeMaid: Confirmation for Reset + + + CodeMaid: Confirmation to Save Pending Changes + + + CodeMaid Delete Items + + + CodeMaid did not find a non-code comment {0} to reformat. + + + CodeMaid: Export + + + CodeMaid failed to load theme '{0}'. See output window for more details. + + + CodeMaid finished formatting the comment. + + + CodeMaid finished formatting the comments {0}. + + + CodeMaid Format Comment + + + CodeMaid has successfully exported + + + CodeMaid has successfully imported {1} from '{0}'. + + + CodeMaid has successfully reset + + + CodeMaid: Import + + + CodeMaid Insert Region + + + CodeMaid is cleaning '{0}'... + + + CodeMaid Join + + + CodeMaid Move Item Above + + + CodeMaid Move Item Below + + + CodeMaid Move Item Into + + + CodeMaid Options + + + CodeMaid Remove All Regions + + + CodeMaid Remove Region + + + CodeMaid Remove Regions + + + CodeMaid Remove Selected Regions + + + CodeMaid reorganized '{0}'. + + + CodeMaid Reorganize for '{0}' + + + CodeMaid: Reorganize Preprocessor Conditionals + + + CodeMaid: Reset + + + CodeMaid Sort + + + CodeMaid Spade + + + CodeMaid turned automatic cleanup on save + + + CodeMaid was unable to export + + + CodeMaid was unable to import + + + CodeMaid was unable to reset + + + Collapse All Solution Explorer + + + Collapse Selected Solution Explorer + + + Collapse solutions when they are opened + + + Collapsing + + + Complexity + + + Conditions + + + Config files (*.config)|*.config|All Files (*.*)|*.* + + + {0} contains preprocessor conditionals (e.g. #if, #pragma) which reorganization does not currently support.\r\n\r\nDo you want to reorganize anyways (DANGEROUS)? + + + dark + + + Deploying + + + Diagnostic + + + Diagnostics + + + Diagnostics mode + + + Digging + + + Digging (Spade) + + + Display + + + Do you want to perform a partial cleanup? + + + Drag to reorder, drag over to group, right click to split, double-click to rename + + + empty + + + Everything else (ex: .txt, README) + + + Exclude + + + Ex: #endregion Methods + + + Export + + + Ex: #region Public Methods, #region Private Methods + + + External + + + Extra indent for values inside XML comments + + + Automatic Cleanup On Save + + + Features Switch + + + Features + + + File Header + + + file order + + + Finding + + + Find In Solution Explorer + + + Font + + + Format Comment + + + Formatting + + + General + + + Handled Exception + + + Hide build progress window when a build stops + + + Icons + + + If there is only one project in a solution, keep it expanded but still collapse its children + + + Import + + + Include + + + Include access level in regions + + + Indentation margin + + + Insert + + + Insert blank line padding after + + + Insert blank line padding before + + + Insert blank line padding between + + + Insert blank space before + + + Insert end of file trailing new line + + + Insert explicit access modifiers on + + + Insert/keep regions even if they are empty + + + Insert new regions + + + in the selection + + + is not in the solution so some cleanup actions may be unavailable. + + + Join Lines + + + Keep members within regions + + + Keep XML tags together + + + light + + + loading... + + + Load models asynchronously + + + Member type order, grouping and preferred names + + + Metadata + + + Miscellaneous + + + Most Complex + + + name only + + + Namespace + + + Navigation + + + New Region + + + no + + + none + + + to be reset to their defaults? + + + Other + + + Other cleaning commands (ex: ReSharper.ReSharper_SilentCleanupCode) + + + Performance + + + Perform partial cleanup if file is not in the solution + + + Perform reorganization when preprocessor conditionals are present + + + Place each command on a separate line + + + Place each regular expression on a separate line + + + Place each set on a separate line + + + Place each using statement on a separate line + + + Place explicit interface members at the end of their group + + + Preview (reopen to refresh) + + + Primary ordering should be by + + + Primary sort should be by + + + Progressing + + + Read-Only + + + Read-Only Toggle + + + Rebuilding + + + refreshing... + + + Regions + + + Regular expressions that match path names to exclude (ex: \.resx$ or \\lib\\ ) + + + Remove + + + &Remove All Regions + + + Remove blank lines + + + Remove blank spaces + + + &Remove Current Region + + + Remove end of file trailing new line + + + Remove end of line whitespace + + + Remove existing regions + + + Remove multiple consecutive blank lines + + + Remove Region + + + Remove regions + + + &Remove Selected Regions + + + CodeMaid is reorganizing '{0}'... + + + Reorganize Active Code + + + Reorganize Active Document + + + Reorganizing + + + Types + + + Reset to Defaults + + + Run format comments during cleanup + + + Run format document + + + Run JetBrains ReSharper cleanup + + + Run remove and sort using statements + + + Run reorganize at start of cleanup + + + Run Telerik JustCode cleanup + + + Run XAML Styler cleanup + + + Save + + + Search CodeMaid Spade (Ctrl+M, ;) + + + . See output window for more details. + + + Select a sub-category to set options. + + + Sets of related file extensions (ex: .cpp .h ) + + + OFF + + + ON + + + Show build progress on Visual Studio icon in Windows taskbar + + + Show build progress window when a build starts + + + Show item complexity (McCabe) + + + Show item metadata + + + Show method parameters + + + Show start page when a solution is closed + + + Skip during automatic cleanup on save + + + Skip wrapping on the last word + + + Solution Explorer + + + Solution-Specific Settings + + + Sort + + + Sort Lines + + + Spade + + + Spade Tool Window + + + Split + + + Successful + + + S&witch File + + + Switch File + + + Switching + + + S&witch to + + + Synchronize outlining with the code file + + + T4 generated code + + + Temporarily open solution folders to find nested items + + + Theme + + + Third Party + + + This action cannot be undone. + + + to '{0}'. + + + Tool Windows + + + type + + + type then access + + + Unable to export + + + Unable to reset + + + Unable to toggle read only state on + + + under the cursor + + + Unsuccessful + + + Update accessors to both be single-line or multi-line (SA1504) + + + Update #endregion tags with region name + + + Update single line methods by placing braces on separate lines (SA1502) + + + User Settings + + + Use undo transactions + + + Using statements to re-insert when removed (ex: using System; ) + + + Visuals + + + Warning + + + Warning threshold + + + was stopped + + + When navigating center on + + + When sorting by type, secondary sort should be by + + + While Cleaning + + + Whitespace + + + whole item + + + Windows taskbar + + + Wrap comments at column + + + yes + + + You have pending changes. Do you want to save them before continuing? + + \ No newline at end of file diff --git a/CodeMaid/Properties/Resources.resx b/CodeMaid/Properties/Resources.resx new file mode 100644 index 00000000..c51b4215 --- /dev/null +++ b/CodeMaid/Properties/Resources.resx @@ -0,0 +1,924 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Unable to import + + + Access levels should be ordered by + + + access then type + + + Add space inside self closing tags + + + Add spacing around XML tags + + + after attributes + + + after opening braces + + + Alert threshold + + + Align XML &lt;param&gt; tags + + + all + + + alphabetical + + + Alphabetize members of the same group + + + Always split all XML tags onto multiple lines + + + Always split &lt;summary&gt; tags onto multiple lines + + + Are you ready for CodeMaid to clean everything in the solution? + + + Are you sure you want all + + + ask + + + at bottom of file + + + at top of file + + + auto-detect + + + Automatic + + + Automatically run cleanup on file save + + + Automatically save and close documents opened by cleanup + + + Automatic Cleanup On Save - + + + Batch + + + before closing angle brackets + + + before closing braces + + + before closing tags + + + between chained statements + + + Building + + + Build Progress + + + Build progress window + + + Cache file code models + + + Cancel + + + Canceling... + + + Cleaning + + + Cleaning + + + File Types + + + Update + + + Cleanup + + + Cleanup Active Code + + + Cleanup Active Document + + + Cleanup All Code + + + Cleanup cannot run while debugging. + + + Cleanup Open Code + + + Cleanup Selected Code + + + Clear Solution Explorer search filtering to find filtered items + + + Close + + + Close All Read-Only + + + CodeMaid cleaned '{0}'. + + + CodeMaid: Cleanup All Code + + + CodeMaid: Cleanup External File + + + CodeMaid Cleanup for '{0}' + + + CodeMaid: Cleanup Progress + + + CodeMaid: Confirmation for Cleanup All Code + + + CodeMaid: Confirmation for Reset + + + CodeMaid: Confirmation to Save Pending Changes + + + CodeMaid Delete Items + + + CodeMaid did not find a non-code comment {0} to reformat. + + + CodeMaid: Export + + + CodeMaid failed to load theme '{0}'. See output window for more details. + + + CodeMaid finished formatting the comment. + + + CodeMaid finished formatting the comments {0}. + + + CodeMaid Format Comment + + + CodeMaid has successfully exported + + + CodeMaid has successfully imported {1} from '{0}'. + + + CodeMaid has successfully reset + + + CodeMaid: Import + + + CodeMaid Insert Region + + + CodeMaid is cleaning '{0}'... + + + CodeMaid Join + + + CodeMaid Move Item Above + + + CodeMaid Move Item Below + + + CodeMaid Move Item Into + + + CodeMaid Options + + + CodeMaid Remove All Regions + + + CodeMaid Remove Region + + + CodeMaid Remove Regions + + + CodeMaid Remove Selected Regions + + + CodeMaid reorganized '{0}'. + + + CodeMaid Reorganize for '{0}' + + + CodeMaid: Reorganize Preprocessor Conditionals + + + CodeMaid: Reset + + + CodeMaid Sort + + + CodeMaid Spade + + + CodeMaid turned automatic cleanup on save + + + CodeMaid was unable to export + + + CodeMaid was unable to import + + + CodeMaid was unable to reset + + + Collapse All Solution Explorer + + + Collapse Selected Solution Explorer + + + Collapse solutions when they are opened + + + Collapsing + + + Complexity + + + Conditions + + + Config files (*.config)|*.config|All Files (*.*)|*.* + + + {0} contains preprocessor conditionals (e.g. #if, #pragma) which reorganization does not currently support.\r\n\r\nDo you want to reorganize anyways (DANGEROUS)? + + + dark + + + Deploying + + + Diagnostic + + + Diagnostics + + + Diagnostics mode + + + Digging + + + Digging (Spade) + + + Display + + + Do you want to perform a partial cleanup? + + + Drag to reorder, drag over to group, right click to split, double-click to rename + + + empty + + + Everything else (ex: .txt, README) + + + Exclude + + + Ex: #endregion Methods + + + Export + + + Ex: #region Public Methods, #region Private Methods + + + External + + + Extra indent for values inside XML comments + + + Automatic Cleanup On Save + + + Features Switch + + + Features + + + File Header + + + file order + + + Finding + + + Find In Solution Explorer + + + Font + + + Format Comment + + + Formatting + + + General + + + Handled Exception + + + Hide build progress window when a build stops + + + Icons + + + If there is only one project in a solution, keep it expanded but still collapse its children + + + Import + + + Include + + + Include access level in regions + + + Indentation margin + + + Insert + + + Insert blank line padding after + + + Insert blank line padding before + + + Insert blank line padding between + + + Insert blank space before + + + Insert end of file trailing new line + + + Insert explicit access modifiers on + + + Insert/keep regions even if they are empty + + + Insert new regions + + + in the selection + + + is not in the solution so some cleanup actions may be unavailable. + + + Join Lines + + + Keep members within regions + + + Keep XML tags together + + + light + + + loading... + + + Load models asynchronously + + + Member type order, grouping and preferred names + + + Metadata + + + Miscellaneous + + + Most Complex + + + name only + + + Namespace + + + Navigation + + + New Region + + + no + + + none + + + to be reset to their defaults? + + + Other + + + Other cleaning commands (ex: ReSharper.ReSharper_SilentCleanupCode) + + + Performance + + + Perform partial cleanup if file is not in the solution + + + Perform reorganization when preprocessor conditionals are present + + + Place each command on a separate line + + + Place each regular expression on a separate line + + + Place each set on a separate line + + + Place each using statement on a separate line + + + Place explicit interface members at the end of their group + + + Preview (reopen to refresh) + + + Primary ordering should be by + + + Primary sort should be by + + + Progressing + + + Read-Only + + + Read-Only Toggle + + + Rebuilding + + + refreshing... + + + Regions + + + Regular expressions that match path names to exclude (ex: \.resx$ or \\lib\\ ) + + + Remove + + + &Remove All Regions + + + Remove blank lines + + + Remove blank spaces + + + &Remove Current Region + + + Remove end of file trailing new line + + + Remove end of line whitespace + + + Remove existing regions + + + Remove multiple consecutive blank lines + + + Remove Region + + + Remove regions + + + &Remove Selected Regions + + + CodeMaid is reorganizing '{0}'... + + + Reorganize Active Code + + + Reorganize Active Document + + + Reorganizing + + + Types + + + Reset to Defaults + + + Run format comments during cleanup + + + Run format document + + + Run JetBrains ReSharper cleanup + + + Run remove and sort using statements + + + Run reorganize at start of cleanup + + + Run Telerik JustCode cleanup + + + Run XAML Styler cleanup + + + Save + + + Search CodeMaid Spade (Ctrl+M, ;) + + + . See output window for more details. + + + Select a sub-category to set options. + + + Sets of related file extensions (ex: .cpp .h ) + + + OFF + + + ON + + + Show build progress on Visual Studio icon in Windows taskbar + + + Show build progress window when a build starts + + + Show item complexity (McCabe) + + + Show item metadata + + + Show method parameters + + + Show start page when a solution is closed + + + Skip during automatic cleanup on save + + + Skip wrapping on the last word + + + Solution Explorer + + + Solution-Specific Settings + + + Sort + + + Sort Lines + + + Spade + + + Spade Tool Window + + + Split + + + Successful + + + S&witch File + + + Switch File + + + Switching + + + S&witch to + + + Synchronize outlining with the code file + + + T4 generated code + + + Temporarily open solution folders to find nested items + + + Theme + + + Third Party + + + This action cannot be undone. + + + to '{0}'. + + + Tool Windows + + + type + + + type then access + + + Unable to export + + + Unable to reset + + + Unable to toggle read only state on + + + under the cursor + + + Unsuccessful + + + Update accessors to both be single-line or multi-line (SA1504) + + + Update #endregion tags with region name + + + Update single line methods by placing braces on separate lines (SA1502) + + + User Settings + + + Use undo transactions + + + Using statements to re-insert when removed (ex: using System; ) + + + Visuals + + + Warning + + + Warning threshold + + + was stopped + + + When navigating center on + + + When sorting by type, secondary sort should be by + + + While Cleaning + + + Whitespace + + + whole item + + + Windows taskbar + + + Wrap comments at column + + + yes + + + You have pending changes. Do you want to save them before continuing? + + \ No newline at end of file diff --git a/CodeMaid/Properties/Resources.zh-Hans.resx b/CodeMaid/Properties/Resources.zh-Hans.resx new file mode 100644 index 00000000..c8d9cfd1 --- /dev/null +++ b/CodeMaid/Properties/Resources.zh-Hans.resx @@ -0,0 +1,924 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 无法导入 + + + 访问级别排序应按 + + + 访问级别 优先于 类型 + + + 在自闭标签中添加空格 + + + 在 XML 标记周围添加间距 + + + 特性后 + + + 打开大括号后 + + + 警报阈值 + + + 对齐 XML <param> 标记 + + + 全部 + + + 字母 + + + 按字母排序同一组内成员 + + + 始终将所有 XML 标记拆分为多行 + + + 始终将 <summary> 标签分到多行 + + + 你准备好使用CodeMaid 清理解决方案中的所有代码了吗? + + + 您确定要所有 + + + 询问 + + + 在文件底部 + + + 在文件顶部 + + + 自动检测 + + + 自动 + + + 在文件保存时自动清理 + + + 自动保存和关闭执行清理时打开的文档 + + + 保存时自动清理 - + + + 批量 + + + 关闭尖括号前 + + + 关闭大括号前 + + + 在结束标记之前 + + + 在链接语句之间 + + + 正在生成 + + + 生成进度 + + + '生成进度'窗口 + + + 缓存文件代码模型 + + + 取消 + + + 正在取消... + + + 正在清理 + + + 清理 + + + 文件类型 + + + 更新 + + + 清理 + + + 清理活动代码 + + + 清理活动文档 + + + 清理所有代码 + + + 调试时无法运行清理。 + + + 清理打开的代码 + + + 清理已选代码 + + + 清除解决方案资源管理器搜索以查找被筛选掉的项目 + + + 关闭 + + + 关闭所有只读 + + + CodeMaid 已清理 "{0}"。 + + + CodeMaid: 清理所有代码 + + + CodeMaid: 清理外部文件 + + + 针对"{0}" 的 CodeMaid 清理 + + + CodeMaid: 清理进度 + + + CodeMaid: 确认清理所有代码 + + + CodeMaid: 确认重置 + + + CodeMaid: 确认保存挂起的更改 + + + CodeMaid 删除条目 + + + CodeMaid 未找到非代码注释 {0} 以重新格式化。 + + + CodeMaid: 导出 + + + CodeMaid 未能加载主题 "{0}"。 有关详细信息, 请参阅输出窗口。 + + + CodeMaid 完成了此注释的格式化。 + + + CodeMaid 完成了注释 {0} 的格式化。 + + + CodeMaid 格式化注释 + + + CodeMaid 已成功导出 + + + CodeMaid 已成功从 "{0}" 导入 {1}。 + + + CodeMaid 已成功重置 + + + CodeMaid: 导入 + + + CodeMaid 插入区域 + + + CodeMaid 正在清理 "{0}"... + + + CodeMaid 连接 + + + CodeMaid 条目上移 + + + CodeMaid 条目下移 + + + CodeMaid 将条目移动到 + + + CodeMaid 选项 + + + CodeMaid 删除所有 #region + + + CodeMaid 删除 #region + + + CodeMaid 删除 #region + + + CodeMaid 删除选定 #region + + + CodeMaid 整理了 "{0}"。 + + + CodeMaid 针对"{0}" 整理 + + + CodeMaid: 整理预处理器条件 + + + CodeMaid: 重置 + + + CodeMaid 排序 + + + CodeMaid 码锹窗口 + + + CodeMaid 已开启保存时自动清理 + + + CodeMaid 无法导出 + + + CodeMaid 无法导入 + + + CodeMaid 无法重置 + + + 折叠所有解决方案资源管理器 + + + 折叠选定的解决方案资源管理器 + + + 在打开解决方案时将其折叠 + + + 折叠 + + + 复杂度 + + + 条件 + + + 配置文件 (*.config)|*.config|所有文件 (*.*)|*.* + + + {0} 包含当前整理不支持的预处理器条件 (例如 #if、#pragma)。 \n 是否仍要整理 (危险)? + + + 深色 + + + 正在部署 + + + 诊断 + + + 诊断 + + + 诊断模式 + + + 代码视图 + + + 码锹 + + + 显示 + + + 是否要执行部分清理? + + + 拖动可重新排序, 拖放到另一项上可分组, 右键单击可拆分, 双击可重命名 + + + + + + 所有其他内容 (比如: .txt, README) + + + 排除 + + + 例如: #endregion 方法 + + + 导出 + + + 例如: #region 公共方法, #region 私有方法 + + + 外部 + + + XML 注释内部值的额外缩进 + + + 保存时自动清理 + + + 功能开关 + + + 功能 + + + 文件头 + + + 文件顺序 + + + 查找 + + + 在解决方案资源管理器中查找 + + + 字体 + + + 格式化注释 + + + 格式化 + + + 常规 + + + 处理异常 + + + 在生成停止时隐藏'生成进度'窗口 + + + 图标 + + + 如果解决方案中只有一个项目, 保持展开但子项任然折叠 + + + 导入 + + + 包含 + + + 在 #regions 中包括访问级别 + + + 缩进边距 + + + 插入 + + + 在之后插入空行 + + + 在前面插入空行 + + + 在之间插入空行 + + + 在前面插入空格 + + + 在文件结尾插入新行标记(EOF) + + + 插入显式访问修饰符 + + + 插入/保留 #regions (即使它们是空的) + + + 插入新 #regions + + + 所选内容 + + + 不在解决方案中, 因此某些清理操作可能不可用。 + + + 连接多行 + + + 保留 #regions 内的成员 + + + 将 XML 标记放在一起 + + + 浅色 + + + 正在加载... + + + 异步加载模型 + + + 成员类型顺序、分组和首选名称 + + + 元数据 + + + 杂项 + + + 最复杂 + + + 仅名称 + + + 命名空间 + + + 导航 + + + 新建 #region + + + + + + + + + 重置为默认值? + + + 其它 + + + 其他清理命令 (比如: ReSharper ReSharper_SilentCleanupCode) + + + 性能 + + + 如果文件不在解决方案中, 则执行部分清理 + + + 在存在预处理器条件时执行整理 + + + 每个命令一行 + + + 每个正则表达式一行 + + + 每个设置一行 + + + 每个 Using 语句一行 + + + 在其组的末尾放置显式接口成员 + + + 预览 (重新打开以刷新) + + + 主要排序应由 + + + 主要排序应为 + + + 进度 + + + 只读 + + + 只读切换 + + + 正在重新生成 + + + 正在刷新... + + + #regions + + + 排除与以下正则表达式相匹配的路径 (例如: \.resx$ or \\lib\\ ) + + + 删除 + + + 移除全部 #regions(&R) + + + 删除空行 + + + 删除空格 + + + 移除当前 #region(&R) + + + 删除文件结尾新行标记(EOF) + + + 删除行尾空白 + + + 删除现有 #regions + + + 删除多个连续的空行 + + + 删除 #region(s) + + + 删除 #regions + + + 移除已选 #regions(&R) + + + CodeMaid 正在整理 "{0}"... + + + 整理活动文档 + + + 整理活动文档 + + + 整理 + + + 类型 + + + 重置为默认 + + + 在清理过程中格式化注释 + + + 运行 '设置文档的格式' + + + 运行 JetBrains ReSharper 清理 + + + 运行 '对 Using 进行删除和排序' + + + 在清理开始时执行整理 + + + 运行 Telerik JustCode 清理 + + + 运行 XAML Styler清理 + + + 保存 + + + 搜索码锹窗口 + + + . 有关详细信息, 请参阅输出窗口。 + + + 选择一个子类别进行设置。 + + + 关联的文件扩展名 (例如: .cpp .h ) + + + + + + + + + 在 Windows 任务栏中的 Visual Studio 图标中显示生成进度 + + + 在生成开始时显示'生成进度'窗口 + + + 显示项目复杂性 (McCabe) + + + 显示项目元数据 + + + 显示方法参数 + + + 关闭解决方案时显示起始页 + + + 当执行自动清理时跳过 + + + 当最后一个词超出注释长度时,不强制换行 + + + 解决方案资源管理器 + + + 解决方案特定设置 + + + 排序 + + + 排序多行 + + + 码锹窗口 + + + 码锹窗口 + + + 拆分 + + + 成功 + + + 切换文件(&W) + + + 切换文件 + + + 切换 + + + 切换至(&W) + + + 将大纲与代码文件同步 + + + T4 生成的代码 + + + 临时打开解决方案文件夹以查找嵌套项目 + + + 主题 + + + 第三方 + + + 无法撤消此操作。 + + + 到 "{0}"。 + + + 工具窗口 + + + 类型 + + + 类型 优先于 访问级别 + + + 无法导出 + + + 无法重置 + + + 无法切换只读状态 + + + 在鼠标下方 + + + 未成功 + + + 将访问器更新为单行或多行 (SA1504) + + + 使用 #region 名称更新 #endregion 标记 + + + 通过在单独的行上放置大括号来更新单行方法 (SA1502) + + + 用户设置 + + + 使用撤消事务 + + + 当被删除时,重新插入以下 Using 语句 (如: using System;) + + + 视觉 + + + 警告 + + + 警告阈值 + + + 被停止 + + + 当导航中心在 + + + 按类型排序时, 次要排序应为 + + + 清理时 + + + 空白 + + + 整个项目 + + + Windows 任务栏 + + + 注释最大列长度 (当长度达到时强制换行) + + + + + + 您有挂起的更改。 是否要在继续之前保存它们? + + \ No newline at end of file diff --git a/CodeMaid/Properties/Settings.Designer.cs b/CodeMaid/Properties/Settings.Designer.cs index 331cbe4c..050d9c48 100644 --- a/CodeMaid/Properties/Settings.Designer.cs +++ b/CodeMaid/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace SteveCadwallader.CodeMaid.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.6.0.0")] public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -1991,5 +1991,236 @@ public bool ThirdParty_UseXAMLStylerCleanup { this["ThirdParty_UseXAMLStylerCleanup"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_BuildProgressToolWindow { + get { + return ((bool)(this["Feature_BuildProgressToolWindow"])); + } + set { + this["Feature_BuildProgressToolWindow"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_CleanupActiveCode { + get { + return ((bool)(this["Feature_CleanupActiveCode"])); + } + set { + this["Feature_CleanupActiveCode"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_CleanupAllCode { + get { + return ((bool)(this["Feature_CleanupAllCode"])); + } + set { + this["Feature_CleanupAllCode"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_CleanupOpenCode { + get { + return ((bool)(this["Feature_CleanupOpenCode"])); + } + set { + this["Feature_CleanupOpenCode"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_CleanupSelectedCode { + get { + return ((bool)(this["Feature_CleanupSelectedCode"])); + } + set { + this["Feature_CleanupSelectedCode"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_CloseAllReadOnly { + get { + return ((bool)(this["Feature_CloseAllReadOnly"])); + } + set { + this["Feature_CloseAllReadOnly"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_CollapseAllSolutionExplorer { + get { + return ((bool)(this["Feature_CollapseAllSolutionExplorer"])); + } + set { + this["Feature_CollapseAllSolutionExplorer"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_CollapseSelectedSolutionExplorer { + get { + return ((bool)(this["Feature_CollapseSelectedSolutionExplorer"])); + } + set { + this["Feature_CollapseSelectedSolutionExplorer"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_CommentFormat { + get { + return ((bool)(this["Feature_CommentFormat"])); + } + set { + this["Feature_CommentFormat"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_FindInSolutionExplorer { + get { + return ((bool)(this["Feature_FindInSolutionExplorer"])); + } + set { + this["Feature_FindInSolutionExplorer"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_JoinLines { + get { + return ((bool)(this["Feature_JoinLines"])); + } + set { + this["Feature_JoinLines"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_ReadOnlyToggle { + get { + return ((bool)(this["Feature_ReadOnlyToggle"])); + } + set { + this["Feature_ReadOnlyToggle"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_RemoveRegion { + get { + return ((bool)(this["Feature_RemoveRegion"])); + } + set { + this["Feature_RemoveRegion"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_ReorganizeActiveCode { + get { + return ((bool)(this["Feature_ReorganizeActiveCode"])); + } + set { + this["Feature_ReorganizeActiveCode"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_SettingCleanupOnSave { + get { + return ((bool)(this["Feature_SettingCleanupOnSave"])); + } + set { + this["Feature_SettingCleanupOnSave"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_SortLines { + get { + return ((bool)(this["Feature_SortLines"])); + } + set { + this["Feature_SortLines"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_SpadeToolWindow { + get { + return ((bool)(this["Feature_SpadeToolWindow"])); + } + set { + this["Feature_SpadeToolWindow"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool Feature_SwitchFile { + get { + return ((bool)(this["Feature_SwitchFile"])); + } + set { + this["Feature_SwitchFile"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n\r\n ReSharper disable \r\n ReSharper enable \r\n")] + public global::System.Collections.Specialized.StringCollection Formatting_IgnoreLinesStartingWith { + get { + return ((global::System.Collections.Specialized.StringCollection)(this["Formatting_IgnoreLinesStartingWith"])); + } + set { + this["Formatting_IgnoreLinesStartingWith"] = value; + } + } } } diff --git a/CodeMaid/Properties/Settings.settings b/CodeMaid/Properties/Settings.settings index 2470383f..5642b769 100644 --- a/CodeMaid/Properties/Settings.settings +++ b/CodeMaid/Properties/Settings.settings @@ -494,5 +494,66 @@ False + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + <?xml version="1.0" encoding="utf-16"?> +<ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <string>ReSharper disable </string> + <string>ReSharper enable </string> +</ArrayOfString> + \ No newline at end of file diff --git a/CodeMaid/UI/Dialogs/CleanupProgress/CleanupProgressWindow.xaml b/CodeMaid/UI/Dialogs/CleanupProgress/CleanupProgressWindow.xaml index 5c5520ee..41c38802 100644 --- a/CodeMaid/UI/Dialogs/CleanupProgress/CleanupProgressWindow.xaml +++ b/CodeMaid/UI/Dialogs/CleanupProgress/CleanupProgressWindow.xaml @@ -8,7 +8,7 @@ xmlns:ui="clr-namespace:SteveCadwallader.CodeMaid.UI" xmlns:p="clr-namespace:SteveCadwallader.CodeMaid.Properties" d:DataContext="{d:DesignInstance local:CleanupProgressViewModel, IsDesignTimeCreatable=False}" - Icon="/SteveCadwallader.CodeMaid;component/source.extension.ico" Title="CodeMaid: Cleanup Progress" + Icon="/SteveCadwallader.CodeMaid;component/source.extension.ico" Title="{x:Static p:Resources.CodeMaidCleanupProgress}" TextElement.FontFamily="{Binding General_Font, Source={x:Static p:Settings.Default}}" Height="180" Width="400" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" ui:WindowAttachedProperties.DialogResult="{Binding DialogResult}" Closing="OnClosing" @@ -28,8 +28,14 @@ - + + + + + + @@ -45,10 +51,10 @@ - public override string Header => "Formatting"; + public override string Header => Resources.FormattingViewModel_Formatting; /// /// Loads the settings. diff --git a/CodeMaid/UI/Dialogs/Options/General/FeaturesDataTemplate.xaml b/CodeMaid/UI/Dialogs/Options/General/FeaturesDataTemplate.xaml new file mode 100644 index 00000000..fc6fba43 --- /dev/null +++ b/CodeMaid/UI/Dialogs/Options/General/FeaturesDataTemplate.xaml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CodeMaid/UI/Dialogs/Options/General/FeaturesViewModel.cs b/CodeMaid/UI/Dialogs/Options/General/FeaturesViewModel.cs new file mode 100644 index 00000000..ab55b454 --- /dev/null +++ b/CodeMaid/UI/Dialogs/Options/General/FeaturesViewModel.cs @@ -0,0 +1,152 @@ +using SteveCadwallader.CodeMaid.Properties; +using Mapping = SteveCadwallader.CodeMaid.UI.Dialogs.Options.SettingToOptionMapping; + +namespace SteveCadwallader.CodeMaid.UI.Dialogs.Options.General +{ + public class FeaturesViewModel : OptionsPageViewModel + { + public FeaturesViewModel(CodeMaidPackage package, Settings activeSettings) + : base(package, activeSettings) + { + Mappings = new SettingsToOptionsList(ActiveSettings, this) + { + new Mapping(x => ActiveSettings.Feature_BuildProgressToolWindow, x => BuildProgressToolWindow), + new Mapping(x => ActiveSettings.Feature_CleanupActiveCode, x => CleanupActiveCode), + new Mapping(x => ActiveSettings.Feature_CleanupAllCode, x => CleanupAllCode), + new Mapping(x => ActiveSettings.Feature_CleanupOpenCode, x => CleanupOpenCode), + new Mapping(x => ActiveSettings.Feature_CleanupSelectedCode, x => CleanupSelectedCode), + new Mapping(x => ActiveSettings.Feature_CloseAllReadOnly, x => CloseAllReadOnly), + new Mapping(x => ActiveSettings.Feature_CollapseAllSolutionExplorer, x => CollapseAllSolutionExplorer), + new Mapping(x => ActiveSettings.Feature_CollapseSelectedSolutionExplorer, x => CollapseSelectedSolutionExplorer), + new Mapping(x => ActiveSettings.Feature_CommentFormat, x => CommentFormat), + new Mapping(x => ActiveSettings.Feature_FindInSolutionExplorer, x => FindInSolutionExplorer), + new Mapping(x => ActiveSettings.Feature_JoinLines, x => JoinLines), + new Mapping(x => ActiveSettings.Feature_ReadOnlyToggle, x => ReadOnlyToggle), + new Mapping(x => ActiveSettings.Feature_RemoveRegion, x => RemoveRegion), + new Mapping(x => ActiveSettings.Feature_ReorganizeActiveCode, x => ReorganizeActiveCode), + new Mapping(x => ActiveSettings.Feature_SettingCleanupOnSave, x => SettingCleanupOnSave), + new Mapping(x => ActiveSettings.Feature_SortLines, x => SortLines), + new Mapping(x => ActiveSettings.Feature_SpadeToolWindow, x => SpadeToolWindow), + new Mapping(x => ActiveSettings.Feature_SwitchFile, x => SwitchFile) + }; + } + + public override string Header => Resources.FeaturesViewModel_Features; + + public bool BuildProgressToolWindow + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool CleanupActiveCode + { + get => GetPropertyValue(); + set + { + SetPropertyValue(value); + + if (!value) + { + SettingCleanupOnSave = false; + } + } + } + + public bool CleanupAllCode + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool CleanupOpenCode + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool CleanupSelectedCode + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool CloseAllReadOnly + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool CollapseAllSolutionExplorer + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool CollapseSelectedSolutionExplorer + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool CommentFormat + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool FindInSolutionExplorer + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool JoinLines + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool ReadOnlyToggle + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool RemoveRegion + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool ReorganizeActiveCode + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool SettingCleanupOnSave + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool SortLines + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool SpadeToolWindow + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + + public bool SwitchFile + { + get => GetPropertyValue(); + set => SetPropertyValue(value); + } + } +} \ No newline at end of file diff --git a/CodeMaid/UI/Dialogs/Options/General/GeneralDataTemplate.xaml b/CodeMaid/UI/Dialogs/Options/General/GeneralDataTemplate.xaml index 8688ac03..7734f962 100644 --- a/CodeMaid/UI/Dialogs/Options/General/GeneralDataTemplate.xaml +++ b/CodeMaid/UI/Dialogs/Options/General/GeneralDataTemplate.xaml @@ -3,10 +3,12 @@ xmlns:local="clr-namespace:SteveCadwallader.CodeMaid.UI.Dialogs.Options.General" xmlns:cnv="clr-namespace:SteveCadwallader.CodeMaid.UI.Converters" xmlns:enums="clr-namespace:SteveCadwallader.CodeMaid.UI.Enumerations" - xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"> + xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase" + xmlns:p="clr-namespace:SteveCadwallader.CodeMaid.Properties"> + - + @@ -35,17 +37,17 @@ - + - - - + + + - + - @@ -110,7 +112,7 @@ - + @@ -122,26 +124,26 @@ - + - - - + + - + - - + + - - + + diff --git a/CodeMaid/UI/Dialogs/Options/General/GeneralViewModel.cs b/CodeMaid/UI/Dialogs/Options/General/GeneralViewModel.cs index fe1727c7..145b3e45 100644 --- a/CodeMaid/UI/Dialogs/Options/General/GeneralViewModel.cs +++ b/CodeMaid/UI/Dialogs/Options/General/GeneralViewModel.cs @@ -39,7 +39,7 @@ public GeneralViewModel(CodeMaidPackage package, Settings activeSettings) /// /// Gets the header. /// - public override string Header => "General"; + public override string Header => Resources.General; #endregion Overrides of OptionsPageViewModel diff --git a/CodeMaid/UI/Dialogs/Options/OptionsViewModel.cs b/CodeMaid/UI/Dialogs/Options/OptionsViewModel.cs index 7d3ada0b..f4902970 100644 --- a/CodeMaid/UI/Dialogs/Options/OptionsViewModel.cs +++ b/CodeMaid/UI/Dialogs/Options/OptionsViewModel.cs @@ -48,7 +48,13 @@ public OptionsViewModel(CodeMaidPackage package, Type initiallySelectedPageType Package = package; Pages = new OptionsPageViewModel[] { - new GeneralViewModel(package, ActiveSettings), + new GeneralViewModel(package, ActiveSettings) + { + Children = new OptionsPageViewModel[] + { + new FeaturesViewModel(package, ActiveSettings) + } + }, new CleaningParentViewModel(package, ActiveSettings) { Children = new OptionsPageViewModel[] @@ -217,10 +223,10 @@ private void OnExportCommandExecuted(object parameter) var activeSettingsName = ActiveSettingsName; var dialog = new Microsoft.Win32.SaveFileDialog { - Title = "CodeMaid: Export " + activeSettingsName, + Title = Resources.CodeMaidExport + activeSettingsName, FileName = "CodeMaid", DefaultExt = ".config", - Filter = "Config files (*.config)|*.config|All Files (*.*)|*.*" + Filter = Resources.ConfigFilesConfigConfigAllFiles }; if (dialog.ShowDialog() == true) @@ -229,14 +235,14 @@ private void OnExportCommandExecuted(object parameter) { File.Copy(ActiveSettingsPath, dialog.FileName, true); - MessageBox.Show(string.Format("CodeMaid has successfully exported " + activeSettingsName + " to '{0}'.", dialog.FileName), - "CodeMaid: Export " + activeSettingsName + " Successful", MessageBoxButton.OK, MessageBoxImage.Information); + MessageBox.Show(string.Format(Resources.CodeMaidHasSuccessfullyExported + activeSettingsName + Resources.To0, dialog.FileName), + Resources.CodeMaidExport + activeSettingsName + Resources.Successful, MessageBoxButton.OK, MessageBoxImage.Information); } catch (Exception ex) { - OutputWindowHelper.ExceptionWriteLine("Unable to export " + activeSettingsName, ex); - MessageBox.Show("CodeMaid was unable to export " + activeSettingsName + ". See output window for more details.", - "CodeMaid: Export " + activeSettingsName + " Unsuccessful", MessageBoxButton.OK, MessageBoxImage.Error); + OutputWindowHelper.ExceptionWriteLine(Resources.UnableToExport + activeSettingsName, ex); + MessageBox.Show(Resources.CodeMaidWasUnableToExport + activeSettingsName + Resources.SeeOutputWindowForMoreDetails, + Resources.CodeMaidExport + activeSettingsName + Resources.Unsuccessful, MessageBoxButton.OK, MessageBoxImage.Error); } } } @@ -266,9 +272,9 @@ private void OnImportCommandExecuted(object parameter) var activeSettingsName = ActiveSettingsName; var dialog = new Microsoft.Win32.OpenFileDialog { - Title = "CodeMaid: Import " + activeSettingsName, + Title = Resources.CodeMaidImport + activeSettingsName, DefaultExt = ".config", - Filter = "Config files (*.config)|*.config|All Files (*.*)|*.*", + Filter = Resources.ConfigFilesConfigConfigAllFiles, CheckFileExists = true }; @@ -283,14 +289,14 @@ private void OnImportCommandExecuted(object parameter) ActiveSettings.Reload(); ReloadPagesFromSettings(); - MessageBox.Show(string.Format("CodeMaid has successfully imported " + activeSettingsName + " from '{0}'.", dialog.FileName), - "CodeMaid: Import " + activeSettingsName + " Successful", MessageBoxButton.OK, MessageBoxImage.Information); + MessageBox.Show(string.Format(Resources.CodeMaidHasSuccessfullyImported1From0, dialog.FileName, activeSettingsName), + Resources.CodeMaidImport + activeSettingsName + Resources.Successful, MessageBoxButton.OK, MessageBoxImage.Information); } catch (Exception ex) { - OutputWindowHelper.ExceptionWriteLine("Unable to import " + activeSettingsName, ex); - MessageBox.Show("CodeMaid was unable to import " + activeSettingsName + ". See output window for more details.", - "CodeMaid: Import " + activeSettingsName + " Unsuccessful", MessageBoxButton.OK, MessageBoxImage.Error); + OutputWindowHelper.ExceptionWriteLine(Resources._UnableToImport + activeSettingsName, ex); + MessageBox.Show(Resources.CodeMaidWasUnableToImport + activeSettingsName + Resources.SeeOutputWindowForMoreDetails, + Resources.CodeMaidImport + activeSettingsName + Resources.Unsuccessful, MessageBoxButton.OK, MessageBoxImage.Error); } } } @@ -313,9 +319,9 @@ private void OnImportCommandExecuted(object parameter) private void OnResetToDefaultsCommandExecuted(object parameter) { var activeSettingsName = ActiveSettingsName; - var result = MessageBox.Show(@"Are you sure you want all " + activeSettingsName + " to be reset to their defaults?" + Environment.NewLine + Environment.NewLine + - @"This action cannot be undone.", - @"CodeMaid: Confirmation for Reset " + activeSettingsName, + var result = MessageBox.Show(Resources.AreYouSureYouWantAll + activeSettingsName + Resources.OptionsViewModel_OnResetToDefaultsCommandExecuted_ToBeResetToTheirDefaults + Environment.NewLine + Environment.NewLine + + Resources.ThisActionCannotBeUndone, + Resources.CodeMaidConfirmationForReset + activeSettingsName, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No); if (result == MessageBoxResult.Yes) @@ -329,14 +335,14 @@ private void OnResetToDefaultsCommandExecuted(object parameter) ActiveSettings.Reload(); ReloadPagesFromSettings(); - MessageBox.Show(string.Format("CodeMaid has successfully reset " + activeSettingsName + "."), - "CodeMaid: Reset " + activeSettingsName + " Successful", MessageBoxButton.OK, MessageBoxImage.Information); + MessageBox.Show(string.Format(Resources.CodeMaidHasSuccessfullyReset + activeSettingsName + "."), + Resources.CodeMaidReset + activeSettingsName + Resources.Successful, MessageBoxButton.OK, MessageBoxImage.Information); } catch (Exception ex) { - OutputWindowHelper.ExceptionWriteLine("Unable to reset " + ActiveSettingsName, ex); - MessageBox.Show("CodeMaid was unable to reset " + activeSettingsName + ". See output window for more details.", - "CodeMaid: Reset " + activeSettingsName + " Unsuccessful", MessageBoxButton.OK, MessageBoxImage.Error); + OutputWindowHelper.ExceptionWriteLine(Resources.UnableToReset + ActiveSettingsName, ex); + MessageBox.Show(Resources.CodeMaidWasUnableToReset + activeSettingsName + Resources.SeeOutputWindowForMoreDetails, + Resources.CodeMaidReset + activeSettingsName + Resources.Unsuccessful, MessageBoxButton.OK, MessageBoxImage.Error); } } } @@ -468,8 +474,8 @@ private bool CheckToSavePendingChangesShouldCancelOperation() { if (HasChanges) { - var result = MessageBox.Show(@"You have pending changes. Do you want to save them before continuing?", - @"CodeMaid: Confirmation to Save Pending Changes", + var result = MessageBox.Show(Resources.YouHavePendingChangesDoYouWantToSaveThemBeforeContinuing, + Resources.CodeMaidConfirmationToSavePendingChanges, MessageBoxButton.YesNoCancel, MessageBoxImage.Question, MessageBoxResult.Cancel); switch (result) @@ -493,7 +499,7 @@ private bool CheckToSavePendingChangesShouldCancelOperation() /// The active or inactive settings name. private string GetSettingsName(bool inactive) { - return IsActiveSolutionSpecificSettings ^ inactive ? "Solution-Specific Settings" : "User Settings"; + return IsActiveSolutionSpecificSettings ^ inactive ? Resources.SolutionSpecificSettings : Resources.UserSettings; } /// diff --git a/CodeMaid/UI/Dialogs/Options/OptionsWindow.xaml b/CodeMaid/UI/Dialogs/Options/OptionsWindow.xaml index 8010d418..36675bef 100644 --- a/CodeMaid/UI/Dialogs/Options/OptionsWindow.xaml +++ b/CodeMaid/UI/Dialogs/Options/OptionsWindow.xaml @@ -10,7 +10,7 @@ xmlns:cnv="clr-namespace:SteveCadwallader.CodeMaid.UI.Converters" xmlns:p="clr-namespace:SteveCadwallader.CodeMaid.Properties" d:DataContext="{d:DesignInstance local:OptionsViewModel, IsDesignTimeCreatable=True}" - Icon="/SteveCadwallader.CodeMaid;component/source.extension.ico" Title="CodeMaid Options" + Icon="/SteveCadwallader.CodeMaid;component/source.extension.ico" Title="{x:Static p:Resources.CodeMaidOptions}" MinHeight="480" MinWidth="640" Height="768" Width="1024" Background="#FFF0F0F0" TextElement.FontFamily="{Binding General_Font, Source={x:Static p:Settings.Default}}" TextElement.FontSize="14" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" @@ -98,6 +98,7 @@ + @@ -173,29 +174,29 @@ - -