From 025fc61ca53b1a65d55eacc71d3271d7620e48e7 Mon Sep 17 00:00:00 2001 From: Matthew Olivo Date: Thu, 7 Sep 2023 21:13:14 -0700 Subject: [PATCH] - Updating naming for Remove Line with text option to be more specific --- MixItUp.Base/Model/Actions/FileActionModel.cs | 18 +++++++++--------- MixItUp.Base/Resources.Designer.cs | 18 +++++++++--------- MixItUp.Base/Resources.resx | 4 ++-- .../FileActionEditorControlViewModel.cs | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/MixItUp.Base/Model/Actions/FileActionModel.cs b/MixItUp.Base/Model/Actions/FileActionModel.cs index 8e9cbff8f..a44223a2e 100644 --- a/MixItUp.Base/Model/Actions/FileActionModel.cs +++ b/MixItUp.Base/Model/Actions/FileActionModel.cs @@ -21,7 +21,7 @@ public enum FileActionTypeEnum RemoveRandomLineFromFile, InsertInFileAtSpecificLine, InsertInFileAtRandomLine, - RemoveSpecificTextFromFile, + RemoveLineWithSpecificTextFromFile, } [DataContract] @@ -63,7 +63,7 @@ protected override async Task PerformInternal(CommandParametersModel parameters) if (this.ActionType == FileActionTypeEnum.ReadFromFile || this.ActionType == FileActionTypeEnum.ReadSpecificLineFromFile || this.ActionType == FileActionTypeEnum.ReadRandomLineFromFile || this.ActionType == FileActionTypeEnum.RemoveSpecificLineFromFile || this.ActionType == FileActionTypeEnum.RemoveRandomLineFromFile || - this.ActionType == FileActionTypeEnum.RemoveSpecificTextFromFile) + this.ActionType == FileActionTypeEnum.RemoveLineWithSpecificTextFromFile) { if (!ServiceManager.Get().IsURLPath(filePath) && !ServiceManager.Get().FileExists(filePath)) { @@ -84,7 +84,7 @@ protected override async Task PerformInternal(CommandParametersModel parameters) if (this.ActionType == FileActionTypeEnum.SaveToFile || this.ActionType == FileActionTypeEnum.AppendToFile || this.ActionType == FileActionTypeEnum.InsertInFileAtSpecificLine || this.ActionType == FileActionTypeEnum.InsertInFileAtRandomLine || - this.ActionType == FileActionTypeEnum.RemoveSpecificTextFromFile) + this.ActionType == FileActionTypeEnum.RemoveLineWithSpecificTextFromFile) { textToWrite = await this.GetTextToSave(parameters); } @@ -92,7 +92,7 @@ protected override async Task PerformInternal(CommandParametersModel parameters) if (this.ActionType == FileActionTypeEnum.ReadFromFile || this.ActionType == FileActionTypeEnum.AppendToFile || this.ActionType == FileActionTypeEnum.ReadSpecificLineFromFile || this.ActionType == FileActionTypeEnum.ReadRandomLineFromFile || this.ActionType == FileActionTypeEnum.RemoveSpecificLineFromFile || this.ActionType == FileActionTypeEnum.RemoveRandomLineFromFile || - this.ActionType == FileActionTypeEnum.RemoveSpecificTextFromFile || + this.ActionType == FileActionTypeEnum.RemoveLineWithSpecificTextFromFile || this.ActionType == FileActionTypeEnum.InsertInFileAtSpecificLine || this.ActionType == FileActionTypeEnum.InsertInFileAtRandomLine) { textToRead = await ServiceManager.Get().ReadFile(filePath); @@ -100,7 +100,7 @@ protected override async Task PerformInternal(CommandParametersModel parameters) if (this.ActionType == FileActionTypeEnum.ReadSpecificLineFromFile || this.ActionType == FileActionTypeEnum.ReadRandomLineFromFile || this.ActionType == FileActionTypeEnum.RemoveSpecificLineFromFile || this.ActionType == FileActionTypeEnum.RemoveRandomLineFromFile || - this.ActionType == FileActionTypeEnum.RemoveSpecificTextFromFile || + this.ActionType == FileActionTypeEnum.RemoveLineWithSpecificTextFromFile || this.ActionType == FileActionTypeEnum.InsertInFileAtSpecificLine || this.ActionType == FileActionTypeEnum.InsertInFileAtRandomLine) { if (!string.IsNullOrEmpty(textToRead)) @@ -128,7 +128,7 @@ protected override async Task PerformInternal(CommandParametersModel parameters) { lineIndex = RandomHelper.GenerateRandomNumber(lines.Count); } - else if (this.ActionType == FileActionTypeEnum.RemoveSpecificTextFromFile) + else if (this.ActionType == FileActionTypeEnum.RemoveLineWithSpecificTextFromFile) { lineIndex = lines.FindIndex(l => l.Equals(textToWrite, this.CaseSensitive ? StringComparison.Ordinal : StringComparison.OrdinalIgnoreCase)); } @@ -154,7 +154,7 @@ protected override async Task PerformInternal(CommandParametersModel parameters) } if (this.ActionType == FileActionTypeEnum.RemoveRandomLineFromFile || this.ActionType == FileActionTypeEnum.RemoveSpecificLineFromFile || - this.ActionType == FileActionTypeEnum.RemoveSpecificTextFromFile) + this.ActionType == FileActionTypeEnum.RemoveLineWithSpecificTextFromFile) { lines.RemoveAt(lineIndex); } @@ -178,7 +178,7 @@ protected override async Task PerformInternal(CommandParametersModel parameters) } if (this.ActionType == FileActionTypeEnum.RemoveSpecificLineFromFile || this.ActionType == FileActionTypeEnum.RemoveRandomLineFromFile || - this.ActionType == FileActionTypeEnum.RemoveSpecificTextFromFile || + this.ActionType == FileActionTypeEnum.RemoveLineWithSpecificTextFromFile || this.ActionType == FileActionTypeEnum.InsertInFileAtSpecificLine || this.ActionType == FileActionTypeEnum.InsertInFileAtRandomLine) { textToWrite = string.Join(Environment.NewLine, lines); @@ -186,7 +186,7 @@ protected override async Task PerformInternal(CommandParametersModel parameters) if (this.ActionType == FileActionTypeEnum.SaveToFile || this.ActionType == FileActionTypeEnum.RemoveSpecificLineFromFile || this.ActionType == FileActionTypeEnum.RemoveRandomLineFromFile || - this.ActionType == FileActionTypeEnum.RemoveSpecificTextFromFile || + this.ActionType == FileActionTypeEnum.RemoveLineWithSpecificTextFromFile || this.ActionType == FileActionTypeEnum.InsertInFileAtSpecificLine || this.ActionType == FileActionTypeEnum.InsertInFileAtRandomLine) { await ServiceManager.Get().SaveFile(filePath, textToWrite); diff --git a/MixItUp.Base/Resources.Designer.cs b/MixItUp.Base/Resources.Designer.cs index 550e6f812..706f55f13 100644 --- a/MixItUp.Base/Resources.Designer.cs +++ b/MixItUp.Base/Resources.Designer.cs @@ -16823,6 +16823,15 @@ public static string Removed { } } + /// + /// Looks up a localized string similar to Remove Line With Specific Text From File. + /// + public static string RemoveLineWithSpecificTextFromFile { + get { + return ResourceManager.GetString("RemoveLineWithSpecificTextFromFile", resourceCulture); + } + } + /// /// Looks up a localized string similar to Remove Moderation Strike. /// @@ -16850,15 +16859,6 @@ public static string RemoveSpecificLineFromFile { } } - /// - /// Looks up a localized string similar to Remove Specific Text From File. - /// - public static string RemoveSpecificTextFromFile { - get { - return ResourceManager.GetString("RemoveSpecificTextFromFile", resourceCulture); - } - } - /// /// Looks up a localized string similar to Remove User Role. /// diff --git a/MixItUp.Base/Resources.resx b/MixItUp.Base/Resources.resx index 5c314ac37..4eff2aa02 100644 --- a/MixItUp.Base/Resources.resx +++ b/MixItUp.Base/Resources.resx @@ -9623,8 +9623,8 @@ update({CurrentAmount}, {GoalAmount}, {Width}); Shell Execute - - Remove Specific Text From File + + Remove Line With Specific Text From File Text To Remove diff --git a/MixItUp.Base/ViewModel/Actions/FileActionEditorControlViewModel.cs b/MixItUp.Base/ViewModel/Actions/FileActionEditorControlViewModel.cs index 4fc7b544e..c67ecd559 100644 --- a/MixItUp.Base/ViewModel/Actions/FileActionEditorControlViewModel.cs +++ b/MixItUp.Base/ViewModel/Actions/FileActionEditorControlViewModel.cs @@ -47,7 +47,7 @@ public bool ShowReadFromFileGrid } } - public bool ShowTextToRemoveGrid { get { return this.SelectedActionType == FileActionTypeEnum.RemoveSpecificTextFromFile; } } + public bool ShowTextToRemoveGrid { get { return this.SelectedActionType == FileActionTypeEnum.RemoveLineWithSpecificTextFromFile; } } public bool ShowLineToWrite { get { return this.SelectedActionType == FileActionTypeEnum.InsertInFileAtSpecificLine; } }