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

This commit is contained in:
Paul Larsen 2025-01-30 09:09:39 -05:00
parent ca61597863
commit 90e25f3fcf

View File

@ -12,6 +12,12 @@ using JR.Utils.GUI.Forms;
namespace VEPROMS.CSLA.Library namespace VEPROMS.CSLA.Library
{ {
public enum E_FieldToEdit { StepText, Text, Number, PSI }; public enum E_FieldToEdit { StepText, Text, Number, PSI };
public enum ReplaceWords
{
Inherit = 0,
Show = 1,
DoNotShow = 2
}
public class DisplayText public class DisplayText
{ {
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
@ -57,19 +63,48 @@ namespace VEPROMS.CSLA.Library
} }
// C2029-025 Show or hide replace words. Can highlight replace words in editor. // C2029-025 Show or hide replace words. Can highlight replace words in editor.
//private bool ShwRplWdsIndex(ItemInfo _MyItemInfo)
//{
// StepConfig sc = _MyItemInfo.MyConfig as StepConfig;
// int setting = sc.Step_ShwRplWdsIndex;
// switch (setting)
// {
// case 2:
// return false;
// break;
// case 1:
// return true;
// break;
// case 0:
// //SectionConfig sc2 = _MyItemInfo.ActiveParent.MyConfig as SectionConfig;
// SectionConfig sc2 = _MyItemInfo.ActiveSection.MyConfig as SectionConfig;
// if (sc2 == null || sc2.Section_ShwRplWords == "Y")
// {
// return true;
// }
// else
// {
// return false;
// }
// break;
// default:
// return false;
// break;
// }
//}
private bool ShwRplWdsIndex(ItemInfo _MyItemInfo) private bool ShwRplWdsIndex(ItemInfo _MyItemInfo)
{ {
StepConfig sc = _MyItemInfo.MyConfig as StepConfig; StepConfig sc = _MyItemInfo.MyConfig as StepConfig;
int setting = sc.Step_ShwRplWdsIndex; int setting = sc.Step_ShwRplWdsIndex;
switch (setting) switch (setting)
{ {
case 2: case (int)ReplaceWords.DoNotShow:
return false; return false;
break; break;
case 1: case (int)ReplaceWords.Show:
return true; return true;
break; break;
case 0: case (int)ReplaceWords.Inherit:
//SectionConfig sc2 = _MyItemInfo.ActiveParent.MyConfig as SectionConfig; //SectionConfig sc2 = _MyItemInfo.ActiveParent.MyConfig as SectionConfig;
SectionConfig sc2 = _MyItemInfo.ActiveSection.MyConfig as SectionConfig; SectionConfig sc2 = _MyItemInfo.ActiveSection.MyConfig as SectionConfig;
if (sc2 == null || sc2.Section_ShwRplWords == "Y") if (sc2 == null || sc2.Section_ShwRplWords == "Y")
@ -86,6 +121,7 @@ namespace VEPROMS.CSLA.Library
break; break;
} }
} }
private Item _MyItem; private Item _MyItem;
private string EditText private string EditText
{ {