C2019-025_Ability-to-Toggle-Replace-Words

This commit is contained in:
2025-01-27 13:38:48 -05:00
parent 71130bd26b
commit 37c5b23a86
12 changed files with 20 additions and 249 deletions

View File

@@ -55,6 +55,8 @@ namespace VEPROMS.CSLA.Library
if (sc == null) return "N";
return sc.Section_ShwRplWords;
}
// C2029-025 Show or hide replace words. Can highlight replace words in editor.
private bool ShwRplWdsIndex(ItemInfo _MyItemInfo)
{
StepConfig sc = _MyItemInfo.MyConfig as StepConfig;
@@ -84,22 +86,6 @@ namespace VEPROMS.CSLA.Library
return false;
break;
}
//int setting = sc.Step_ShwRplWdsIndex;
//if (setting == 3) return false;
//if (setting == 2) return true;
//if (setting == 1 || setting == 0)
//{
// SectionConfig sc2 = _MyItemInfo.ActiveParent.MyConfig as SectionConfig;
// if (sc2.Section_ShwRplWords == "Y")
// {
// return true;
// }
// else
// {
// return false;
// }
//}
//return false; // if Step_ShwRplWdsIndex = 0
}
private Item _MyItem;
private string EditText
@@ -412,13 +398,10 @@ namespace VEPROMS.CSLA.Library
// But don't do ReplaceWords if the TurnOffReplaceWords format flag is set
if (wordsShouldBeReplaced && !_MyItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.TurnOffReplaceWords)
{
//string stf = _MyItemInfo.SectionConfig.Section_ShwRplWords;
//ItemInfoList stf = _MyItemInfo.MyPrevious.Sections//SectionConfig.Section_ShwRplWords;
//_MyItemInfo.SectionConfig.Section_ShwRplWords;
//string str = _MyItemInfo.MyConfig.Section_ShwRplWords;
//epMode
int profileDepth1 = ProfileTimer.Push(">>>> DoReplaceWords2");
// C2029-025 Show or hide replace words. Can highlight replace words in editor.
if (_MyItemInfo.IsSection)
{
string ShwRplWrds = ShwRplWords(_MyItemInfo);
@@ -2245,11 +2228,6 @@ namespace VEPROMS.CSLA.Library
// CASEINSENS: Do ReplaceWords for all words that match, regardless of case, and replace with the ReplaceWith string as is
//RegexOptions myOptions = (rs.Flag & E_ReplaceFlags.CaseInsens) == E_ReplaceFlags.CaseInsens ? RegexOptions.IgnoreCase & RegexOptions.Singleline : RegexOptions.None & RegexOptions.Singleline;
string replaceWord = Regex.Replace(rs.ReplaceWord, @"[[\]\\()]", @"\$0");
//if (Volian.Controls.Library.Properties.Settings.Default.cbShwRplWrdsColor)
//{
// replaceWord = $@"\cf2{replaceWord}\cf0";
// // with = $@"\cf2{with}\cf0 ";
//}
// if first or last character in replaceword is a non-word character, for example, ',', ')', or '.',
// don't use the \W, i.e. don't bother to look for a non-word character.