diff --git a/PROMS/VEPROMS.CSLA.Library/Format/Comparator.cs b/PROMS/VEPROMS.CSLA.Library/Format/Comparator.cs index 14e7fc87..e6ff1820 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/Comparator.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/Comparator.cs @@ -1,40 +1,23 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Xml; -using System.Windows.Forms; namespace VEPROMS.CSLA.Library { public class Comparator { - private XmlDocument _ResultsDoc; - public XmlDocument ResultsDoc - { - get { return _ResultsDoc; } - set { _ResultsDoc = value; } - } - private XmlDocument _XDoc1; - public XmlDocument XDoc1 - { - get { return _XDoc1; } - set { _XDoc1 = value; } - } - private XmlDocument _XDoc2; - public XmlDocument XDoc2 - { - get { return _XDoc2; } - set { _XDoc2 = value; } - } - public Comparator(XmlDocument xdoc1, XmlDocument xdoc2) + public XmlDocument ResultsDoc { get; set; } + public XmlDocument XDoc1 { get; set; } + public XmlDocument XDoc2 { get; set; } + public Comparator(XmlDocument xdoc1, XmlDocument xdoc2) { XDoc1 = xdoc1; XDoc2 = xdoc2; ResultsDoc = new XmlDocument(); ResultsDoc.LoadXml(@""); } - public Comparator(string existingFC, string importedFC) //string fName1, string fName2) + public Comparator(string existingFC, string importedFC) { XDoc1 = new XmlDocument(); XDoc1.LoadXml(existingFC); @@ -104,12 +87,12 @@ namespace VEPROMS.CSLA.Library xnss1.Add(GetKey(xc1), xc1); foreach (XmlNode xc2 in xns2.Values) if (xnss1.ContainsKey(GetKey(xc2))) - Compare(xnss1[GetKey(xc2)], xc2, path + "/" + GetKey(xc2)); + Compare(xnss1[GetKey(xc2)], xc2, $"{path}/{GetKey(xc2)}"); else xnss2.Add(GetKey(xc2), xc2); // element differences, if counts are different. xns1 elements are not found in xns2 and xns2 elements are not found in xns1 if (xns1.Count == 0 && xns2.Count == 0) return; - Console.WriteLine(" {0} {1} {2}", path + "/" + xn1.Name, xns1.Count, xns2.Count); + Console.WriteLine($" {path}/{xn1.Name} {xns1.Count} {xns2.Count}"); foreach (string key in xnss1.Keys) { if (xnss1[key].Attributes.Count > 0 || xnss1[key].ChildNodes.Count > 0) @@ -210,18 +193,14 @@ namespace VEPROMS.CSLA.Library public string GetKey1(XmlNode xn) { if (xn.Attributes == null) return xn.Name; - XmlAttribute xi = xn.Attributes.GetNamedItem("Index") as XmlAttribute; - if (xi != null) - { - XmlAttribute xa = xn.Attributes.GetNamedItem("Name") as XmlAttribute; - if (xa != null) return string.Format("{0}[{1}]", xn.Name, xa.Value); - return string.Format("{0}[{1}]", xn.Name, xi.Value); - } - XmlAttribute xt = xn.Attributes.GetNamedItem("Token") as XmlAttribute; - if(xt != null) return string.Format("{0}[{1}]", xn.Name, xt.Value); - XmlAttribute xw = xn.Attributes.GetNamedItem("ReplaceWord") as XmlAttribute; - if(xw != null) return string.Format("{0}[{1}]", xn.Name, xw.Value); - return xn.Name; + if (xn.Attributes.GetNamedItem("Index") is XmlAttribute xi) + { + if (xn.Attributes.GetNamedItem("Name") is XmlAttribute xa) return string.Format("{0}[{1}]", xn.Name, xa.Value); + return string.Format("{0}[{1}]", xn.Name, xi.Value); + } + if (xn.Attributes.GetNamedItem("Token") is XmlAttribute xt) return string.Format("{0}[{1}]", xn.Name, xt.Value); + if (xn.Attributes.GetNamedItem("ReplaceWord") is XmlAttribute xw) return string.Format("{0}[{1}]", xn.Name, xw.Value); + return xn.Name; } static private XmlNode makeXPath(XmlDocument doc, string xpath) { @@ -252,7 +231,6 @@ namespace VEPROMS.CSLA.Library string name = nextNodeInXPath.Substring(indx, nextNodeInXPath.IndexOf("=",indx)-indx); XmlAttribute xKeyd = doc.CreateAttribute(name); indx = nextNodeInXPath.IndexOf("='",indx)+2; - string value = nextNodeInXPath.Substring(indx,nextNodeInXPath.IndexOf("'", indx) - indx); xKeyd.Value = nextNodeInXPath.Substring(indx,nextNodeInXPath.IndexOf("'",indx)-indx); node.Attributes.Append(xKeyd); } @@ -277,58 +255,56 @@ namespace VEPROMS.CSLA.Library // go through attributes in first xml document, see if they exist in the 2nd xml document & are identical attribute foreach (XmlAttribute xa1 in atts1) { - XmlAttribute xa2 = atts2.GetNamedItem(xa1.Name) as XmlAttribute; - if (xa2 == null) - { - XmlNode xnr = MakeXPathFormat(path); - if (xnr != null) - { - XmlAttribute xKey = ResultsDoc.CreateAttribute(xa1.Name+"Old"); - xKey.Value = xa1.Value; - xnr.Attributes.Append(xKey); - xKey = ResultsDoc.CreateAttribute("OldKey"); - xKey.Value = GetKey(atts1Par); - if (xKey.Value != null) xnr.Attributes.Append(xKey); - } - } - else if (xa2.Value != xa1.Value) - { - XmlNode xnr = MakeXPathFormat(path); - if (xnr != null) - { - XmlAttribute xKey = ResultsDoc.CreateAttribute(xa1.Name + "Old"); - xKey.Value = xa1.Value; - xnr.Attributes.Append(xKey); - XmlAttribute xKey2 = ResultsDoc.CreateAttribute(xa2.Name + "New"); - xKey2.Value = xa2.Value; - xnr.Attributes.Append(xKey2); - xKey = ResultsDoc.CreateAttribute("OldKey"); - xKey.Value = GetKey(atts1Par); - if (xKey.Value != null) xnr.Attributes.Append(xKey); - xKey = ResultsDoc.CreateAttribute("NewKey"); - xKey.Value = GetKey(atts2Par); - if (xKey.Value != null) xnr.Attributes.Append(xKey); - } - } - } + if (!(atts2.GetNamedItem(xa1.Name) is XmlAttribute xa2)) + { + XmlNode xnr = MakeXPathFormat(path); + if (xnr != null) + { + XmlAttribute xKey = ResultsDoc.CreateAttribute(xa1.Name + "Old"); + xKey.Value = xa1.Value; + xnr.Attributes.Append(xKey); + xKey = ResultsDoc.CreateAttribute("OldKey"); + xKey.Value = GetKey(atts1Par); + if (xKey.Value != null) xnr.Attributes.Append(xKey); + } + } + else if (xa2.Value != xa1.Value) + { + XmlNode xnr = MakeXPathFormat(path); + if (xnr != null) + { + XmlAttribute xKey = ResultsDoc.CreateAttribute(xa1.Name + "Old"); + xKey.Value = xa1.Value; + xnr.Attributes.Append(xKey); + XmlAttribute xKey2 = ResultsDoc.CreateAttribute(xa2.Name + "New"); + xKey2.Value = xa2.Value; + xnr.Attributes.Append(xKey2); + xKey = ResultsDoc.CreateAttribute("OldKey"); + xKey.Value = GetKey(atts1Par); + if (xKey.Value != null) xnr.Attributes.Append(xKey); + xKey = ResultsDoc.CreateAttribute("NewKey"); + xKey.Value = GetKey(atts2Par); + if (xKey.Value != null) xnr.Attributes.Append(xKey); + } + } + } // go through attributes in 2nd xml document to see if they exist in the first xml document & are identical foreach (XmlAttribute xa2 in atts2) { - XmlAttribute xa1 = atts1.GetNamedItem(xa2.Name) as XmlAttribute; - if (xa1 == null) - { - XmlNode xnr = MakeXPathFormat(path); - if (xnr != null) - { - XmlAttribute xKey = ResultsDoc.CreateAttribute(xa2.Name+"New"); - xKey.Value = xa2.Value; - xnr.Attributes.Append(xKey); - xKey = ResultsDoc.CreateAttribute("NewKey"); - xKey.Value = GetKey(atts2Par); - if (xKey.Value != null) xnr.Attributes.Append(xKey); - } - } - } + if (!(atts1.GetNamedItem(xa2.Name) is XmlAttribute)) + { + XmlNode xnr = MakeXPathFormat(path); + if (xnr != null) + { + XmlAttribute xKey = ResultsDoc.CreateAttribute(xa2.Name + "New"); + xKey.Value = xa2.Value; + xnr.Attributes.Append(xKey); + xKey = ResultsDoc.CreateAttribute("NewKey"); + xKey.Value = GetKey(atts2Par); + if (xKey.Value != null) xnr.Attributes.Append(xKey); + } + } + } } #endregion } diff --git a/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs b/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs index de3187f2..02ab8036 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/DocStyles.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; using System.ComponentModel; using System.Xml; @@ -13,14 +11,8 @@ namespace VEPROMS.CSLA.Library [Description("Document Styles Name")] //Not used in the PROMS code. Only used as a title for the DocStyles grouping private LazyLoad _Name; - public string Name - { - get - { - return LazyLoad(ref _Name, "@Name"); - } - } - private DocStyleList _DocStyleList; + public string Name => LazyLoad(ref _Name, "@Name"); + private DocStyleList _DocStyleList; public DocStyleList DocStyleList { get @@ -68,38 +60,20 @@ namespace VEPROMS.CSLA.Library #region IndexName // a unuque number that is use in the SQL record to referenced the DocStyle for a seciton private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - [Description("Document Styles Name")] + public int? Index => LazyLoad(ref _Index, "@Index"); + [Description("Document Styles Name")] // Use in the lists that display the name of a seciton format style (Section Properties) private LazyLoad _Name; - public string Name - { - get - { - return LazyLoad(ref _Name, "@Name"); - } - } - #endregion - #region Font - // the font to use for the section - private VE_Font _Font; - [Category("Font")] - [DisplayName("Font")] - [Description("Font")] - public VE_Font Font - { - get - { - return(_Font == null) ?_Font = new VE_Font(XmlNode): _Font; - } - } - #endregion + public string Name => LazyLoad(ref _Name, "@Name"); + #endregion + #region Font + // the font to use for the section + private VE_Font _Font; + [Category("Font")] + [DisplayName("Font")] + [Description("Font")] + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); + #endregion #region AdjustTopMarginOnStepContinuePages // B2017-267 Put in for Farley who uses the "PSOnlyFirst" in some of their pagelists so that a section title is printed only on the first page of the section. // This will adjust the top margin when the section title is not printed on the other pages. (CreateStepPDF() in PromsPrinter.cs) @@ -125,413 +99,245 @@ namespace VEPROMS.CSLA.Library // count just within this section, don't count, etc). // - see E_NumberingSequence in Enum.cs private LazyLoad _NumberingSequence; - public E_NumberingSequence? NumberingSequence - { - get - { - return LazyLoad(ref _NumberingSequence, "@NumberingSequence"); - } - } - #endregion numberingsequence + public E_NumberingSequence? NumberingSequence => LazyLoad(ref _NumberingSequence, "@NumberingSequence"); + #endregion numberingsequence - #region IndexOtherThanFirstPage - [Category("Miscellaneous")] + #region IndexOtherThanFirstPage + [Category("Miscellaneous")] [Description("IndexOtherThanFirstPage")] // references the DocStyle to use for pages two through the last page of the section. this is used along with the "Where" setting "UseOnFirstPage" private LazyLoad _IndexOtherThanFirstPage; - public int? IndexOtherThanFirstPage - { - get - { - return LazyLoad(ref _IndexOtherThanFirstPage, "@IndexOtherThanFirstPage"); - } - } - #endregion IndexOtherThanFirstPage + public int? IndexOtherThanFirstPage => LazyLoad(ref _IndexOtherThanFirstPage, "@IndexOtherThanFirstPage"); + #endregion IndexOtherThanFirstPage - #region SecOvrideSupInfoTabOff - // This overrides the tab position of the Supplemental Information steps at the section level - // This will also override the overall supplemental Information tab adjustment set at the format level (SupInfoTabOff) - [Category("Miscellaneous")] + #region SecOvrideSupInfoTabOff + // This overrides the tab position of the Supplemental Information steps at the section level + // This will also override the overall supplemental Information tab adjustment set at the format level (SupInfoTabOff) + [Category("Miscellaneous")] [Description("SecOvrideSupInfoTabOff")] private LazyLoad _SecOvrideSupInfoTabOff; - public int? SecOvrideSupInfoTabOff - { - get - { - return LazyLoad(ref _SecOvrideSupInfoTabOff, "@SecOvrideSupInfoTabOff"); - } - } - #endregion SecOvrideSupInfoTabOff + public int? SecOvrideSupInfoTabOff => LazyLoad(ref _SecOvrideSupInfoTabOff, "@SecOvrideSupInfoTabOff"); + #endregion SecOvrideSupInfoTabOff - #region IsStepSection - [Category("Miscellaneous")] + #region IsStepSection + [Category("Miscellaneous")] [Description("Is a Step Section")] // When set to True, the section uses the PROMS Step editor, when set to False, Word is used to edit the section contents private LazyLoad _IsStepSection; - public bool IsStepSection - { - get - { - return LazyLoad(ref _IsStepSection, "@IsStepSection"); - } - } - #endregion IsStepSection + public bool IsStepSection => LazyLoad(ref _IsStepSection, "@IsStepSection"); + #endregion IsStepSection - #region Inactive - [Category("Miscellaneous")] + #region Inactive + [Category("Miscellaneous")] [Description("Is Active Section Type")] // when set to True, the section type is hidden from the user // - but this section type could still be used "internally" by PROMS (i.e. when "Where" is set to "UseOnAllButFirstPage") // - is also used to keep un-used section types around for future use private LazyLoad _Inactive; - public bool Inactive - { - get - { - return LazyLoad(ref _Inactive, "@Inactive"); - } - } - #endregion Inactive + public bool Inactive => LazyLoad(ref _Inactive, "@Inactive"); + #endregion Inactive - #region SupplementalInfo - [Category("Miscellaneous")] + #region SupplementalInfo + [Category("Miscellaneous")] [Description("Supports Supplemental Information")] // Use in SAMG procedures, flag that tells PROMS this section type can have Supplemental Information. // This information is entered as an RNO off of a step but is printed on the backside of the previous page // (like a foldout page) so that it is visable along with the steps that it applies. private LazyLoad _SupplementalInformation; - public bool SupplementalInformation - { - get - { - return LazyLoad(ref _SupplementalInformation, "@SupplementalInformation"); - } - } + public bool SupplementalInformation => LazyLoad(ref _SupplementalInformation, "@SupplementalInformation"); - // B2023-060: Procedures with Supplemental Information will assume that all sections are printed separately. - // This flag will use the Section's properties/pagination (continuous or separate) - // rather than always setting to separate - [Category("Miscellaneous")] + // B2023-060: Procedures with Supplemental Information will assume that all sections are printed separately. + // This flag will use the Section's properties/pagination (continuous or separate) + // rather than always setting to separate + [Category("Miscellaneous")] [Description("Supports Supplemental Information Pagination")] private LazyLoad _SupInfoNoPaginOverride; - public bool SupInfoNoPaginOverride - { - get - { - return LazyLoad(ref _SupInfoNoPaginOverride, "@SupInfoNoPaginOverride"); - } - } + public bool SupInfoNoPaginOverride => LazyLoad(ref _SupInfoNoPaginOverride, "@SupInfoNoPaginOverride"); - // F2023-035: WCN - allow for change in left margin for supplemental information pages by - // setting a value in the DocStyle for the adjustment. This is used when importing the vlnParagraph page - // page & when doing pagelist items - // summary: adjustment to the left margin for the associated supplemental information pages - private LazyLoad _SupInfoMargAdj; - public float? SupInfoMargAdj - { - get - { - return LazyLoad(ref _SupInfoMargAdj, "@SupInfoMargAdj"); - } - } + // F2023-035: WCN - allow for change in left margin for supplemental information pages by + // setting a value in the DocStyle for the adjustment. This is used when importing the vlnParagraph page + // page & when doing pagelist items + // summary: adjustment to the left margin for the associated supplemental information pages + private LazyLoad _SupInfoMargAdj; + public float? SupInfoMargAdj => LazyLoad(ref _SupInfoMargAdj, "@SupInfoMargAdj"); - #endregion SupplementalInfo + #endregion SupplementalInfo - #region LandscapePageList - [Category("Miscellaneous")] + #region LandscapePageList + [Category("Miscellaneous")] [Description("Should PageList be landscape")] // this will rotate the associated PageStyle information 180 degrees to the left private LazyLoad _LandscapePageList; - public bool LandscapePageList - { - get - { - return LazyLoad(ref _LandscapePageList, "@LandscapePageList"); - } - } - #endregion LandscapePageList - - #region ShowSectionTitles - [Category("Miscellaneous")] + public bool LandscapePageList => LazyLoad(ref _LandscapePageList, "@LandscapePageList"); + #endregion LandscapePageList + + #region ShowSectionTitles + [Category("Miscellaneous")] [Description("Should Section Titles be shown")] private LazyLoad _ShowSectionTitles; - // like the ShowSectionTitles at the StepSectionLayData level - turns on printing the section number and title on the first page of the section. This allows it to be controled based on which section type was selected, so long as it's set to false at the StepSectionLayData level. - public bool ShowSectionTitles - { - get - { - return LazyLoad(ref _ShowSectionTitles, "@ShowSectionTitles"); - } - } - #endregion ShowSectionTitles + // like the ShowSectionTitles at the StepSectionLayData level - turns on printing the section number and title on the first page of the section. This allows it to be controled based on which section type was selected, so long as it's set to false at the StepSectionLayData level. + public bool ShowSectionTitles => LazyLoad(ref _ShowSectionTitles, "@ShowSectionTitles"); + #endregion ShowSectionTitles - #region ResetFirstPageOnSection - [Category("Miscellaneous")] + #region ResetFirstPageOnSection + [Category("Miscellaneous")] [Description("Reset first page of section on Separate pagination section")] // put in for V.C. Summer private LazyLoad _ResetFirstPageOnSection; - public bool ResetFirstPageOnSection - { - get - { - return LazyLoad(ref _ResetFirstPageOnSection, "@ResetFirstPageOnSection"); - } - } - #endregion ResetFirstPageOnSection + public bool ResetFirstPageOnSection => LazyLoad(ref _ResetFirstPageOnSection, "@ResetFirstPageOnSection"); + #endregion ResetFirstPageOnSection - #region IncludeInTOC - [Category("Miscellaneous")] + #region IncludeInTOC + [Category("Miscellaneous")] [Description("Include in Auto Table Of Contents")] // this will include the section in the Automatic Table Of Contents by default (unless it's turned off in Section Properties) private LazyLoad _IncludeInTOC; - public bool IncludeInTOC - { - get - { - return LazyLoad(ref _IncludeInTOC, "@IncludeInTOC"); - } - } - #endregion IncludeInTOC + public bool IncludeInTOC => LazyLoad(ref _IncludeInTOC, "@IncludeInTOC"); + #endregion IncludeInTOC - #region UseCheckOffs - [Category("Miscellaneous")] + #region UseCheckOffs + [Category("Miscellaneous")] [Description("Section Uses Checkoffs")] // turns on the ability for a step editor section to have checkoffs private LazyLoad _UseCheckOffs; - public bool UseCheckOffs - { - get - { - return LazyLoad(ref _UseCheckOffs, "@UseCheckOffs"); - } - } - #endregion UseCheckOffs + public bool UseCheckOffs => LazyLoad(ref _UseCheckOffs, "@UseCheckOffs"); + #endregion UseCheckOffs - #region UseCheckOffs - [Category("Miscellaneous")] + #region UseCheckOffs + [Category("Miscellaneous")] [Description("Section Uses MetaSection ColSByLevel")] // the section uses the MetaSection ColSByLevel setting (based on step text level) to position the step on the page private LazyLoad _UseColSByLevel; - public bool UseColSByLevel - { - get - { - return LazyLoad(ref _UseColSByLevel, "@UseColSByLevel"); - } - } - #endregion UseCheckOffs + public bool UseColSByLevel => LazyLoad(ref _UseColSByLevel, "@UseColSByLevel"); + #endregion UseCheckOffs - #region CancelSectTitle - [Category("Miscellaneous")] + #region CancelSectTitle + [Category("Miscellaneous")] [Description("Section Cancel Section Title")] // this will prevent the section number and title from printing at the beginning of the section. This is set to false when the section number and/or title is printed from the PageStyle instead private LazyLoad _CancelSectTitle; - public bool CancelSectTitle - { - get - { - return LazyLoad(ref _CancelSectTitle, "@CancelSectTitle"); - } - } - #endregion CancelSectTitle + public bool CancelSectTitle => LazyLoad(ref _CancelSectTitle, "@CancelSectTitle"); + #endregion CancelSectTitle - #region DontInsertBlankPages - [Category("Miscellaneous")] + #region DontInsertBlankPages + [Category("Miscellaneous")] [Description("Don't insert blank pages in this section when printing duplex with blank pages")] //C2023-001 Added for Beaver Valley CAS sections (their two column format) private LazyLoad _DontInsertBlankPages; - public bool DontInsertBlankPages - { - get - { - return LazyLoad(ref _DontInsertBlankPages, "@DontInsertBlankPages"); - } - } - #endregion DontInsertBlankPages + public bool DontInsertBlankPages => LazyLoad(ref _DontInsertBlankPages, "@DontInsertBlankPages"); + #endregion DontInsertBlankPages - #region CenterLine - //CenterLineX="261.9" CenterLineYTop="673.2" CenterLineYBottom="44.2" - private LazyLoad _CenterLineX; - [Category("CenterLine")] - [DisplayName("X Location")] - [Description("Distance from left side of page")] - // horizontal positon of a center line that is drawn on the printed page - public float? CenterLineX - { - get - { - return LazyLoad(ref _CenterLineX, "@CenterLineX"); - } - } + #region CenterLine + //CenterLineX="261.9" CenterLineYTop="673.2" CenterLineYBottom="44.2" + private LazyLoad _CenterLineX; + [Category("CenterLine")] + [DisplayName("X Location")] + [Description("Distance from left side of page")] + // horizontal positon of a center line that is drawn on the printed page + public float? CenterLineX => LazyLoad(ref _CenterLineX, "@CenterLineX"); - // the vertical starting positon of a center line that is drawn on the printed page - private LazyLoad _CenterLineYTop; - [Category("CenterLine")] - [DisplayName("Y Top Location")] - [Description("starting vertical point of line")] - public float? CenterLineYTop - { - get - { - return LazyLoad(ref _CenterLineYTop, "@CenterLineYTop"); - } - } + // the vertical starting positon of a center line that is drawn on the printed page + private LazyLoad _CenterLineYTop; + [Category("CenterLine")] + [DisplayName("Y Top Location")] + [Description("starting vertical point of line")] + public float? CenterLineYTop => LazyLoad(ref _CenterLineYTop, "@CenterLineYTop"); - // the vertical ending positon of a center line that is drawn on the printed page - private LazyLoad _CenterLineYBottom; - [Category("CenterLine")] - [DisplayName("Y Bottom Location")] - [Description("ending vertical point of line")] - public float? CenterLineYBottom - { - get - { - return LazyLoad(ref _CenterLineYBottom, "@CenterLineYBottom"); - } - } + // the vertical ending positon of a center line that is drawn on the printed page + private LazyLoad _CenterLineYBottom; + [Category("CenterLine")] + [DisplayName("Y Bottom Location")] + [Description("ending vertical point of line")] + public float? CenterLineYBottom => LazyLoad(ref _CenterLineYBottom, "@CenterLineYBottom"); - private LazyLoad _CLineWidth; - [Category("CenterLine")] - [DisplayName("Line Width")] - [Description("Width of Lines Internal to Boxes")] - - // overrides the default pen width (.95) used to draw the center line - public float? CLineWidth - { - get - { - return LazyLoad(ref _CLineWidth, "@CLineWidth"); - } - } - #endregion CenterLine + private LazyLoad _CLineWidth; + [Category("CenterLine")] + [DisplayName("Line Width")] + [Description("Width of Lines Internal to Boxes")] - #region OptionalSectionContent - [Category("Miscellaneous")] + // overrides the default pen width (.95) used to draw the center line + public float? CLineWidth => LazyLoad(ref _CLineWidth, "@CLineWidth"); + #endregion CenterLine + + #region OptionalSectionContent + [Category("Miscellaneous")] [Description("Section Optional Content")] // don't print the "No Section Content" message when section is empty private LazyLoad _OptionalSectionContent; - public bool OptionalSectionContent - { - get - { - return LazyLoad(ref _OptionalSectionContent, "@OptionalSectionContent"); - } - } - #endregion OptionalSectionContent + public bool OptionalSectionContent => LazyLoad(ref _OptionalSectionContent, "@OptionalSectionContent"); + #endregion OptionalSectionContent - #region Section Number Flags - [Category("Miscellaneous")] + #region Section Number Flags + [Category("Miscellaneous")] [Description("Don't parse the section number - use DisplayNumber value")] // when creating a section tab, use as was entered in section properties private LazyLoad _DontParseSectionNumber; - public bool DontParseSectionNumber - { - get - { - return LazyLoad(ref _DontParseSectionNumber, "@DontParseSectionNumber"); - } - } - #endregion + public bool DontParseSectionNumber => LazyLoad(ref _DontParseSectionNumber, "@DontParseSectionNumber"); + #endregion - #region SpecialStepsFoldout - [Category("Miscellaneous")] + #region SpecialStepsFoldout + [Category("Miscellaneous")] [Description("Section Special Steps Foldout")] // (for step editor foldouts) reduces white space on the foldout page to allow more information on the page, // also special handling of step tabs when section numbers normally are part of step numbers private LazyLoad _SpecialStepsFoldout; - public bool SpecialStepsFoldout - { - get - { - return LazyLoad(ref _SpecialStepsFoldout, "@SpecialStepsFoldout"); - } - } + public bool SpecialStepsFoldout => LazyLoad(ref _SpecialStepsFoldout, "@SpecialStepsFoldout"); - [Category("Miscellaneous")] + [Category("Miscellaneous")] [Description("Section Special Steps Foldout with white space")] // allow for all of the other special foldout formatting, but not compress the page private LazyLoad _SpecialStepsFoldoutKeepWhiteSpace; - public bool SpecialStepsFoldoutKeepWhiteSpace - { - get - { - return LazyLoad(ref _SpecialStepsFoldoutKeepWhiteSpace, "@SpecialStepsFoldoutKeepWhiteSpace"); - } - } + public bool SpecialStepsFoldoutKeepWhiteSpace => LazyLoad(ref _SpecialStepsFoldoutKeepWhiteSpace, "@SpecialStepsFoldoutKeepWhiteSpace"); - [Category("Miscellaneous")] + [Category("Miscellaneous")] [Description("Section Extra Line Header")] // add and extra blank line before a Caution/Note header, appears to be used with SpecialStepsFoldout logic // and the SpaceIn set on Caution and Note step types private LazyLoad _ExtraLineHeader; - public bool ExtraLineHeader - { - get - { - return LazyLoad(ref _ExtraLineHeader, "@ExtraLineHeader"); - } - } - #endregion SpecialStepsFoldout + public bool ExtraLineHeader => LazyLoad(ref _ExtraLineHeader, "@ExtraLineHeader"); + #endregion SpecialStepsFoldout - #region UndSpecialStepsFoldout - [Category("Miscellaneous")] + #region UndSpecialStepsFoldout + [Category("Miscellaneous")] [Description("Section Cancel Section Title")] // used in Foldout section types, will underline the High Level Steps of a Foldout (Step Editor Section) private LazyLoad _UndSpecialStepsFoldout; - public bool UndSpecialStepsFoldout - { - get - { - return LazyLoad(ref _UndSpecialStepsFoldout, "@UndSpecialStepsFoldout"); - } - } - #endregion UndSpecialStepsFoldout + public bool UndSpecialStepsFoldout => LazyLoad(ref _UndSpecialStepsFoldout, "@UndSpecialStepsFoldout"); + #endregion UndSpecialStepsFoldout - #region CoverNoMergedPageNum - [Category("Miscellaneous")] + #region CoverNoMergedPageNum + [Category("Miscellaneous")] [Description("Cover Page Do Not Show Page Count")] // F2021-046: When doing the Merge option when printing all procedures, flag if cover page section // doesn't print the merged page number on first page of the merged pdf (used in printing Alarm Procedure sets) - private LazyLoad _CoverNoMergedPageNum; - public bool CoverNoMergedPageNum - { - get - { - return LazyLoad(ref _CoverNoMergedPageNum, "@CoverNoMergedPageNum"); - } - } - #endregion CoverNoMergedPageNum + private LazyLoad _CoverNoMergedPageNum; + public bool CoverNoMergedPageNum => LazyLoad(ref _CoverNoMergedPageNum, "@CoverNoMergedPageNum"); + #endregion CoverNoMergedPageNum - #region AlignHLSTabWithSect - [Category("Miscellaneous")] + #region AlignHLSTabWithSect + [Category("Miscellaneous")] [Description("Align HLS Tab With Sect")] // Align the starting position of the High Level Step to be under the section header (section title). // The step width is also ajusted to fit within the page margins private LazyLoad _AlignHLSTabWithSect; - public bool AlignHLSTabWithSect - { - get - { - return LazyLoad(ref _AlignHLSTabWithSect, "@AlignHLSTabWithSect"); - } - } - #endregion AlignHLSTabWithSect + public bool AlignHLSTabWithSect => LazyLoad(ref _AlignHLSTabWithSect, "@AlignHLSTabWithSect"); + #endregion AlignHLSTabWithSect - #region AdjSectTitleLoc - [Category("Miscellaneous")] + #region AdjSectTitleLoc + [Category("Miscellaneous")] [Description("Adjust Section Title Location")] // When high level steps are used as the high level section number and title (a ".0" is added to the high level @@ -540,44 +346,27 @@ namespace VEPROMS.CSLA.Library // This was added to support Barakah’s meta sections step/sub-step tabbing and the INITIAL sign off header // placement in the page header. private LazyLoad _AdjSectTitleLoc; - public bool AdjSectTitleLoc // B2022-129: don't indent HLS when flag is on (Barakah - single column step attachment with meta sect) - { - get - { - return LazyLoad(ref _AdjSectTitleLoc, "@AdjSectTitleLoc"); - } - } + public bool AdjSectTitleLoc // B2022-129: don't indent HLS when flag is on (Barakah - single column step attachment with meta sect) +=> LazyLoad(ref _AdjSectTitleLoc, "@AdjSectTitleLoc"); - // this will add additional spacing between the Section Numbers and Titles - private LazyLoad _SectTitleOffsetOverride; - public float? SectTitleOffsetOverride - { - get - { - return LazyLoad(ref _SectTitleOffsetOverride, "@SectTitleOffsetOverride"); - } - } + // this will add additional spacing between the Section Numbers and Titles + private LazyLoad _SectTitleOffsetOverride; + public float? SectTitleOffsetOverride => LazyLoad(ref _SectTitleOffsetOverride, "@SectTitleOffsetOverride"); - #endregion AdjSectTitleLoc + #endregion AdjSectTitleLoc - #region ShowAlarmPointWindowInfo - [Category("Miscellaneous")] + #region ShowAlarmPointWindowInfo + [Category("Miscellaneous")] [Description("Show Alarm Point Table Info in Step Editor")] //C2021-018 show alarm point RO data in step editor (BNPP Alarms) // used to display Alarm Point Table RO values in the editor. A read-only Note type is used, off of step the section title, to display the Alarm Point table RO information. private LazyLoad _ShowAlarmPointWindowInfo; - public bool ShowAlarmPointWindowInfo - { - get - { - return LazyLoad(ref _ShowAlarmPointWindowInfo, "@ShowAlarmPointWindowInfo"); - } - } - #endregion ShowAlarmPointWindowInfo + public bool ShowAlarmPointWindowInfo => LazyLoad(ref _ShowAlarmPointWindowInfo, "@ShowAlarmPointWindowInfo"); + #endregion ShowAlarmPointWindowInfo - #region ComponentList - [Category("Miscellaneous")] + #region ComponentList + [Category("Miscellaneous")] [Description("Component List")] // this is used generate a could different types of section and step formatting. @@ -586,17 +375,11 @@ namespace VEPROMS.CSLA.Library // It's used for Calvert Cliffs Alarm Point pages, Calvert Cliffs Valve List sections, // and Farley Component List tales (Figure section in EOP procedures). private LazyLoad _ComponentList; - public bool ComponentList - { - get - { - return LazyLoad(ref _ComponentList, "@ComponentList"); - } - } - #endregion ComponentList + public bool ComponentList => LazyLoad(ref _ComponentList, "@ComponentList"); + #endregion ComponentList - #region pagestyle - private PageStyle _pagestyle; + #region pagestyle + private PageStyle _pagestyle; [Category("Miscellaneous")] [DisplayName("Page Style")] [Description("Page Style")] @@ -607,8 +390,8 @@ namespace VEPROMS.CSLA.Library get { string str = "//PageStyles/PageStyle[" + (IntLookup("@PageStyle") + 1).ToString() + "]"; - XmlNode xn = SelectSingleNode(str); - if (_pagestyle == null) _pagestyle = new PageStyle(SelectSingleNode("//PageStyles/PageStyle[" + (IntLookup("@PageStyle") + 1).ToString() + "]")); + _ = SelectSingleNode(str); + if (_pagestyle == null) _pagestyle = new PageStyle(SelectSingleNode($"//PageStyles/PageStyle[{IntLookup("@PageStyle") + 1}]")); return _pagestyle; } } @@ -616,74 +399,29 @@ namespace VEPROMS.CSLA.Library #region SubElements private Layout _Layout; - public Layout Layout - { - get - { - return (_Layout == null ? _Layout = new Layout(SelectSingleNode("Layout")) : _Layout); - } - } - private SectTop _SectTop; - public SectTop SectTop - { - get - { - return (_SectTop == null ? _SectTop = new SectTop(SelectSingleNode("SectTop")) : _SectTop); - } - } - private Continue _Continue; - public Continue Continue - { - get - { - return (_Continue == null ? _Continue = new Continue(SelectSingleNode("Continue")) : _Continue); - } - } - private End _End; - public End End - { - get - { - return (_End == null ? _End = new End(SelectSingleNode("End")) : _End); - } - } - private Final _Final; - public Final Final - { - get - { - return (_Final == null ? _Final = new Final(SelectSingleNode("Final")) : _Final); - } - } - private StructureStyle _StructureStyle; - public StructureStyle StructureStyle - { - get - { - return (_StructureStyle == null ? _StructureStyle = new StructureStyle(SelectSingleNode("StructureStyle")) : _StructureStyle); - } - } - #endregion + public Layout Layout => _Layout ?? (_Layout = new Layout(SelectSingleNode("Layout"))); + private SectTop _SectTop; + public SectTop SectTop => _SectTop ?? (_SectTop = new SectTop(SelectSingleNode("SectTop"))); + private Continue _Continue; + public Continue Continue => _Continue ?? (_Continue = new Continue(SelectSingleNode("Continue"))); + private End _End; + public End End => _End ?? (_End = new End(SelectSingleNode("End"))); + private Final _Final; + public Final Final => _Final ?? (_Final = new Final(SelectSingleNode("Final"))); + private StructureStyle _StructureStyle; + public StructureStyle StructureStyle => _StructureStyle ?? (_StructureStyle = new StructureStyle(SelectSingleNode("StructureStyle"))); + #endregion - #region AltMultiUnitWording - [Category("Miscellaneous")] + #region AltMultiUnitWording + [Category("Miscellaneous")] [Description("Alternate Wording for Printing when MultiUnit")] // this will utilize Alternate Wording for Printing when MultiUnit and PrintCommonForZeroUnit is set private LazyLoad _AltMultiUnitWording; - public string AltMultiUnitWording - { - get - { - return LazyLoad(ref _AltMultiUnitWording, "@AltMultiUnitWording"); - } - } - #endregion IncludeInTOC - public override string ToString() - { - return String.Format("{0:D2} - {1}", Index, Name); - } - } + public string AltMultiUnitWording => LazyLoad(ref _AltMultiUnitWording, "@AltMultiUnitWording"); + #endregion IncludeInTOC + public override string ToString() => $"{Index:D2} - {Name}"; + } #endregion #region DocStyleList [TypeConverter(typeof(vlnListConverter))] @@ -710,53 +448,35 @@ namespace VEPROMS.CSLA.Library public Layout() : base() { } #region TopMargin private LazyLoad _TopMargin; - [Category("Layout")] - [DisplayName("Top Margin on Printed Page")] - [Description("Top Margin on Printed Page")] + [Category("Layout")] + [DisplayName("Top Margin on Printed Page")] + [Description("Top Margin on Printed Page")] - // The top point of the printed page to start printing the step text (or section number/title) - public float? TopMargin - { - get - { - return LazyLoad(ref _TopMargin, "@TopMargin"); - } - } - #endregion - #region FooterLength - private LazyLoad _FooterLength; - [Category("Location")] - [DisplayName("Number of lines required for footer")] - [Description("Number of lines required for footer")] + // The top point of the printed page to start printing the step text (or section number/title) + public float? TopMargin => LazyLoad(ref _TopMargin, "@TopMargin"); + #endregion + #region FooterLength + private LazyLoad _FooterLength; + [Category("Location")] + [DisplayName("Number of lines required for footer")] + [Description("Number of lines required for footer")] - // space to reserve if needed for bottom page messages (ex: continue message) - public float? FooterLength - { - get - { - return LazyLoad(ref _FooterLength, "@FooterLength"); - } - } - #endregion - #region ChangeBarAdjustment - // B2023-052: Beaver Valley - Inconsistent change bar location - private LazyLoad _AbsChgBarAdj; - [Category("Location")] - [DisplayName("Absolute change bar adjustment for margin differences")] - [Description("Absolute change bar adjustment for margin differences")] + // space to reserve if needed for bottom page messages (ex: continue message) + public float? FooterLength => LazyLoad(ref _FooterLength, "@FooterLength"); + #endregion + #region ChangeBarAdjustment + // B2023-052: Beaver Valley - Inconsistent change bar location + private LazyLoad _AbsChgBarAdj; + [Category("Location")] + [DisplayName("Absolute change bar adjustment for margin differences")] + [Description("Absolute change bar adjustment for margin differences")] - // when AbsoluteFixedChangeColumn flag is used it is from the LeftMargin. If a unique section has a different LeftMarge define, change bars in that section will not be located at the same location as the other sections. This allows for an adjustment to the change bar location to match the other sections - public float? AbsChgBarAdj - { - get - { - return LazyLoad(ref _AbsChgBarAdj, "@AbsChgBarAdj"); - } - } - #endregion ChangeBarAdjustment + // when AbsoluteFixedChangeColumn flag is used it is from the LeftMargin. If a unique section has a different LeftMarge define, change bars in that section will not be located at the same location as the other sections. This allows for an adjustment to the change bar location to match the other sections + public float? AbsChgBarAdj => LazyLoad(ref _AbsChgBarAdj, "@AbsChgBarAdj"); + #endregion ChangeBarAdjustment - #region LeftMargin - private LazyLoad _LeftMargin; + #region LeftMargin + private LazyLoad _LeftMargin; [Category("Location")] [DisplayName("Size of left margin")] [Description("Size of left margin")] @@ -834,86 +554,56 @@ namespace VEPROMS.CSLA.Library #region PageWidth private LazyLoad _PageWidth; - [Category("Location")] - [DisplayName("Width of Page")] - [Description("Width of Page")] + [Category("Location")] + [DisplayName("Width of Page")] + [Description("Width of Page")] - // width of the printed page from the LeftMargin (defines the Right Margin of the section) - public float? PageWidth - { - get - { - return LazyLoad(ref _PageWidth, "@PageWidth"); - } - } - #endregion PageWidth + // width of the printed page from the LeftMargin (defines the Right Margin of the section) + public float? PageWidth => LazyLoad(ref _PageWidth, "@PageWidth"); + #endregion PageWidth - #region MSWordXAdj - private LazyLoad _MSWordXAdj; - [Category("Location")] - [DisplayName("MSWord X Adjustment")] - [Description("X Placement of PDF during Print")] + #region MSWordXAdj + private LazyLoad _MSWordXAdj; + [Category("Location")] + [DisplayName("MSWord X Adjustment")] + [Description("X Placement of PDF during Print")] - // used for landscape Word sections, adjusts the Horizontal position on the printed page - public float? MSWordXAdj - { - get - { - return LazyLoad(ref _MSWordXAdj, "@MSWordXAdj"); - } - } - #endregion MSWordXAdj + // used for landscape Word sections, adjusts the Horizontal position on the printed page + public float? MSWordXAdj => LazyLoad(ref _MSWordXAdj, "@MSWordXAdj"); + #endregion MSWordXAdj - #region MSWordYAdj - private LazyLoad _MSWordYAdj; - [Category("Location")] - [DisplayName("MSWord Y Adjustment")] - [Description("Y Placement of PDF during Print")] + #region MSWordYAdj + private LazyLoad _MSWordYAdj; + [Category("Location")] + [DisplayName("MSWord Y Adjustment")] + [Description("Y Placement of PDF during Print")] - // used for landscape Word sections, adjusts the Vertical position on the printed page - public float? MSWordYAdj - { - get - { - return LazyLoad(ref _MSWordYAdj, "@MSWordYAdj"); - } - } - #endregion MSWordYAdj + // used for landscape Word sections, adjusts the Vertical position on the printed page + public float? MSWordYAdj => LazyLoad(ref _MSWordYAdj, "@MSWordYAdj"); + #endregion MSWordYAdj - #region SectionMacro - private LazyLoad _SectionMacro; - [Category("Extras")] - [DisplayName("Section Macro")] - [Description("Section Macro Prints With Title")] + #region SectionMacro + private LazyLoad _SectionMacro; + [Category("Extras")] + [DisplayName("Section Macro")] + [Description("Section Macro Prints With Title")] - // will print a defined print macro with the section title. - // (ex. Westinghouse Alarms format will print a solid line before the section title - // for the "Line Above Section Title" section style) - public string SectionMacro - { - get - { - return LazyLoad(ref _SectionMacro, "@SectionMacro"); - } - } - #endregion SectionMacro + // will print a defined print macro with the section title. + // (ex. Westinghouse Alarms format will print a solid line before the section title + // for the "Line Above Section Title" section style) + public string SectionMacro => LazyLoad(ref _SectionMacro, "@SectionMacro"); + #endregion SectionMacro - #region CenterToStepThenPage - [Category("Layout")] + #region CenterToStepThenPage + [Category("Layout")] [Description("CenterToStepThenPage")] // centering position of Tables and Figures is calulated first with repect to the table or figure width, then that positionm is centered with respect the printable page width and left margin private LazyLoad _CenterToStepThenPage; - public bool CenterToStepThenPage - { - get - { - return LazyLoad(ref _CenterToStepThenPage, "@CenterToStepThenPage"); - } - } - #endregion CenterToStepThenPage - } + public bool CenterToStepThenPage => LazyLoad(ref _CenterToStepThenPage, "@CenterToStepThenPage"); + #endregion CenterToStepThenPage + } #endregion Layout #region SectTopWcnTraining @@ -924,64 +614,40 @@ namespace VEPROMS.CSLA.Library public SectTop() : base() { } #region Font private VE_Font _Font; - [Category("Font")] - [DisplayName("Font")] - [Description("Font")] - public VE_Font Font - { - get - { - return (_Font == null) ? _Font = new VE_Font(XmlNode) : _Font; - } - } - #endregion - #region Margin - private LazyLoad _Margin; - [Category("Section Continue Msg")] - [DisplayName("Margin for Section top msg")] - [Description("Margin for Section top msg")] + [Category("Font")] + [DisplayName("Font")] + [Description("Font")] + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); + #endregion + #region Margin + private LazyLoad _Margin; + [Category("Section Continue Msg")] + [DisplayName("Margin for Section top msg")] + [Description("Margin for Section top msg")] - // used to position Responsibility text for Wolf Creek Training format - public float? Margin - { - get - { - return LazyLoad(ref _Margin, "@Margin"); - } - } - #endregion Margin + // used to position Responsibility text for Wolf Creek Training format + public float? Margin => LazyLoad(ref _Margin, "@Margin"); + #endregion Margin - #region MaxLen - private LazyLoad _MaxLen; - [Category("Section Continue Msg")] - [DisplayName("MaxLen for text within the column")] - [Description("MaxLen for text within the column")] + #region MaxLen + private LazyLoad _MaxLen; + [Category("Section Continue Msg")] + [DisplayName("MaxLen for text within the column")] + [Description("MaxLen for text within the column")] - // the maxium length of Responsibility text (Wolf Creek Training format) - public int? MaxLen - { - get - { - return LazyLoad(ref _MaxLen, "@MaxLen"); - } - } - #endregion MaxLen - #region Message - private LazyLoad _Message; - [Category("Continue Msg")] - [DisplayName("Section Top Continue Msg")] - [Description("Section Top Continue Msg")] + // the maxium length of Responsibility text (Wolf Creek Training format) + public int? MaxLen => LazyLoad(ref _MaxLen, "@MaxLen"); + #endregion MaxLen + #region Message + private LazyLoad _Message; + [Category("Continue Msg")] + [DisplayName("Section Top Continue Msg")] + [Description("Section Top Continue Msg")] - // top continue message used only for Wolf Creek Training format - public string Message - { - get - { - return LazyLoad(ref _Message, "@Message"); - } - } - #endregion Message - } + // top continue message used only for Wolf Creek Training format + public string Message => LazyLoad(ref _Message, "@Message"); + #endregion Message + } #endregion SectTopWcnTraining #region ContinueAll @@ -993,44 +659,20 @@ namespace VEPROMS.CSLA.Library public Continue() : base() { } #region Font private VE_Font _Font; - [Category("Continue Msg")] - [DisplayName("Font")] - [Description("Font")] - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } - #endregion - #region SubElements - private Top _Top; - public Top Top - { - get - { - return (_Top == null? _Top = new Top(SelectSingleNode("Top")): _Top); - } - } - private Bottom _Bottom; - public Bottom Bottom - { - get - { - return (_Bottom == null ? _Bottom = new Bottom(SelectSingleNode("Bottom")) : _Bottom); - } - } - private SectionTitle _SectionTitle; - public SectionTitle SectionTitle - { - get - { - return (_SectionTitle == null ? _SectionTitle = new SectionTitle(SelectSingleNode("SectionTitle")) : _SectionTitle); - } - } - #endregion - } + [Category("Continue Msg")] + [DisplayName("Font")] + [Description("Font")] + public VE_Font Font => _Font ?? (_Font = new VE_Font(base.XmlNode)); + #endregion + #region SubElements + private Top _Top; + public Top Top => _Top ?? (_Top = new Top(SelectSingleNode("Top"))); + private Bottom _Bottom; + public Bottom Bottom => _Bottom ?? (_Bottom = new Bottom(SelectSingleNode("Bottom"))); + private SectionTitle _SectionTitle; + public SectionTitle SectionTitle => _SectionTitle ?? (_SectionTitle = new SectionTitle(SelectSingleNode("SectionTitle"))); + #endregion + } #endregion #region Top [TypeConverter(typeof(ExpandableObjectConverter))] @@ -1040,138 +682,86 @@ namespace VEPROMS.CSLA.Library public Top() : base() { } #region Font private VE_Font _Font; - [Category("Font")] - [DisplayName("Font")] - [Description("Font")] - public VE_Font Font - { - get - { - return (_Font == null) ? _Font = new VE_Font(XmlNode) : _Font; - } - } - #endregion - #region Margin - private LazyLoad _Margin; - [Category("Continue Msg")] - [DisplayName("Margin for top msg")] - [Description("Margin for top msg")] + [Category("Font")] + [DisplayName("Font")] + [Description("Font")] + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); + #endregion + #region Margin + private LazyLoad _Margin; + [Category("Continue Msg")] + [DisplayName("Margin for top msg")] + [Description("Margin for top msg")] - //value added to the left margin when calculating the center point of a top continue message. - public float? Margin - { - get - { - return LazyLoad(ref _Margin, "@Margin"); - } - } - #endregion Margin + //value added to the left margin when calculating the center point of a top continue message. + public float? Margin => LazyLoad(ref _Margin, "@Margin"); + #endregion Margin - #region RowOverride - // C2019-044 put in for Barakah Single Column format - // specify the row to put the top continue message - // this allows us to put the Top Continue Message on the same row as the checkoff (initials) header - per their writer's guide - private LazyLoad _RowOverride; - [Category("Continue Msg")] - [DisplayName("Top msg on specific row")] - [Description("Top msg on specific row")] - public float? RowOverride - { - get - { - return LazyLoad(ref _RowOverride, "@RowOverride"); - } - } - #endregion + #region RowOverride + // C2019-044 put in for Barakah Single Column format + // specify the row to put the top continue message + // this allows us to put the Top Continue Message on the same row as the checkoff (initials) header - per their writer's guide + private LazyLoad _RowOverride; + [Category("Continue Msg")] + [DisplayName("Top msg on specific row")] + [Description("Top msg on specific row")] + public float? RowOverride => LazyLoad(ref _RowOverride, "@RowOverride"); + #endregion - #region UseStepTabs - private LazyLoad _UseStepTabs; - [Category("Continue Msg")] - [DisplayName("Flag to use step tabs")] - [Description("Flag to use step tabs")] + #region UseStepTabs + private LazyLoad _UseStepTabs; + [Category("Continue Msg")] + [DisplayName("Flag to use step tabs")] + [Description("Flag to use step tabs")] - // added for Comanche Peak will print out step tabs as a top comtinue message. - public bool UseStepTabs - { - get - { - return LazyLoad(ref _UseStepTabs, "@UseStepTabs"); - } - } - #endregion UseStepTabs + // added for Comanche Peak will print out step tabs as a top comtinue message. + public bool UseStepTabs => LazyLoad(ref _UseStepTabs, "@UseStepTabs"); + #endregion UseStepTabs - #region HLS - private LazyLoad _HLS; - [Category("Continue Msg")] - [DisplayName("Include HLS in top continue msg")] - [Description("Include HLS in top continue msg")] + #region HLS + private LazyLoad _HLS; + [Category("Continue Msg")] + [DisplayName("Include HLS in top continue msg")] + [Description("Include HLS in top continue msg")] - // include the High Level Step in the top continue message - // - see DoTopContinueMsg in VlnParagraph for details - // set to "1" will use high level step tab and text - // set to "4" the high level step text is the section title, appears when fist level sub-step breaks - // set to "7" similar logic as "4" but for Vogtle Main Control Room alarms but use high level step text - // set to "6" handle when break occures on Caution/Note - // set to "3" special logic for Calvert Cliffs Alarms (the two column part) - public int? HLS - { - get - { - return LazyLoad(ref _HLS, "@HLS"); - } - } - #endregion HLS + // include the High Level Step in the top continue message + // - see DoTopContinueMsg in VlnParagraph for details + // set to "1" will use high level step tab and text + // set to "4" the high level step text is the section title, appears when fist level sub-step breaks + // set to "7" similar logic as "4" but for Vogtle Main Control Room alarms but use high level step text + // set to "6" handle when break occures on Caution/Note + // set to "3" special logic for Calvert Cliffs Alarms (the two column part) + public int? HLS => LazyLoad(ref _HLS, "@HLS"); + #endregion HLS - #region PlaceAtLeftMargin - private LazyLoad _PlaceAtLeftMargin; // F2019-033 only use the Left Margin plus any Top message margin - [Category("Continue Msg")] - [DisplayName("Flag to position at left margin")] - [Description("Flag to position at left margin")] + #region PlaceAtLeftMargin + private LazyLoad _PlaceAtLeftMargin; // F2019-033 only use the Left Margin plus any Top message margin + [Category("Continue Msg")] + [DisplayName("Flag to position at left margin")] + [Description("Flag to position at left margin")] - // position the top continue message with respect only to the left margin - public bool PlaceAtLeftMargin - { - get - { - return LazyLoad(ref _PlaceAtLeftMargin, "@PlaceAtLeftMargin"); - } - } - #endregion PlaceAtLeftMargin + // position the top continue message with respect only to the left margin + public bool PlaceAtLeftMargin => LazyLoad(ref _PlaceAtLeftMargin, "@PlaceAtLeftMargin"); + #endregion PlaceAtLeftMargin - #region Message - private LazyLoad _RemoveBullet; - public bool RemoveBullet // C2021-024: WCN1 if bullet exists in combined tab, stop right before bullet. - { - get - { - return LazyLoad(ref _RemoveBullet, "@RemoveBullet"); - } - } + #region Message + private LazyLoad _RemoveBullet; + public bool RemoveBullet // C2021-024: WCN1 if bullet exists in combined tab, stop right before bullet. +=> LazyLoad(ref _RemoveBullet, "@RemoveBullet"); - private LazyLoad _DontIncludeRNOTabIfHasAERParent; - public bool DontIncludeRNOTabIfHasAERParent // F2026-002: Vogtle Units 3&4 Top Continue Message. - { - get - { - return LazyLoad(ref _DontIncludeRNOTabIfHasAERParent, "@DontIncludeRNOTabIfHasAERParent"); - } - } + private LazyLoad _DontIncludeRNOTabIfHasAERParent; + public bool DontIncludeRNOTabIfHasAERParent // F2026-002: Vogtle Units 3&4 Top Continue Message. +=> LazyLoad(ref _DontIncludeRNOTabIfHasAERParent, "@DontIncludeRNOTabIfHasAERParent"); - private LazyLoad _Message; - [Category("Continue Msg")] - [DisplayName("Top Continue Msg")] - [Description("Top Continue Msg")] + private LazyLoad _Message; + [Category("Continue Msg")] + [DisplayName("Top Continue Msg")] + [Description("Top Continue Msg")] - // the top continue message string - may caontain special formatting items - see DoTopContinueMsg in vlnParagraph for different format settings - public string Message - { - get - { - return LazyLoad(ref _Message, "@Message"); - } - } - #endregion Message - } + // the top continue message string - may caontain special formatting items - see DoTopContinueMsg in vlnParagraph for different format settings + public string Message => LazyLoad(ref _Message, "@Message"); + #endregion Message + } #endregion Top @@ -1183,120 +773,72 @@ namespace VEPROMS.CSLA.Library public Bottom() : base() { } #region Font private VE_Font _Font; - [Category("Font")] - [DisplayName("Font")] - [Description("Font")] - public VE_Font Font - { - get - { - return (_Font == null) ? _Font = new VE_Font(XmlNode) : _Font; - } - } - #endregion - #region Margin - private LazyLoad _Margin; - [Category("Continue Msg")] - [DisplayName("Margin for bottom msg")] - [Description("Margin for bottom msg")] + [Category("Font")] + [DisplayName("Font")] + [Description("Font")] + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); + #endregion + #region Margin + private LazyLoad _Margin; + [Category("Continue Msg")] + [DisplayName("Margin for bottom msg")] + [Description("Margin for bottom msg")] - // horitzontal position of the bottom continue message from the left margin - public float? Margin - { - get - { - return LazyLoad(ref _Margin, "@Margin"); - } - } - #endregion Margin + // horitzontal position of the bottom continue message from the left margin + public float? Margin => LazyLoad(ref _Margin, "@Margin"); + #endregion Margin - #region MarginR BGE - private LazyLoad _MarginR; - [Category("Continue Msg")] - [DisplayName("Margin for bottom msg RNO Column (if in both columns)")] - [Description("Margin for bottom msg RNO Column (if in both columns)")] + #region MarginR BGE + private LazyLoad _MarginR; + [Category("Continue Msg")] + [DisplayName("Margin for bottom msg RNO Column (if in both columns)")] + [Description("Margin for bottom msg RNO Column (if in both columns)")] - // horitzontal position from the left margin for a RNO bottom continue message - public float? MarginR - { - get - { - return LazyLoad(ref _MarginR, "@MarginR"); - } - } - #endregion MarginR BGE + // horitzontal position from the left margin for a RNO bottom continue message + public float? MarginR => LazyLoad(ref _MarginR, "@MarginR"); + #endregion MarginR BGE - #region Location - [Category("Continue Msg")] + #region Location + [Category("Continue Msg")] [Description("Bottom Continue Location")] private LazyLoad _Location; - // location of the bottom continue message - // E_ContBottomLoc list (ENum.cs): - // EndOfText = 0, - // BtwnTextAndBottom = 1, - // BottomOfPage = 2, - // BelowBottom1 = 3, - // BottomWithFooter = 4, - added for BGE for Alarms. This puts continue message on bottom AND if in CONDITION/RESPONSE table, at bottom of both columns. - // EndOfText2 = 5, - // BtwnTextAndBottom2 = 6 - Added for BGE, their continue message was a line or so too far down the page + // location of the bottom continue message + // E_ContBottomLoc list (ENum.cs): + // EndOfText = 0, + // BtwnTextAndBottom = 1, + // BottomOfPage = 2, + // BelowBottom1 = 3, + // BottomWithFooter = 4, - added for BGE for Alarms. This puts continue message on bottom AND if in CONDITION/RESPONSE table, at bottom of both columns. + // EndOfText2 = 5, + // BtwnTextAndBottom2 = 6 - Added for BGE, their continue message was a line or so too far down the page - public E_ContBottomLoc? Location - { - get - { - return LazyLoad(ref _Location, "@Location"); - } - } + public E_ContBottomLoc? Location => LazyLoad(ref _Location, "@Location"); - // flag for cases where step text was printing on top of the bottom continue messsage due to how a step was paginated - put in for Farley - private LazyLoad _NoOverrideSpace; - public bool NoOverrideSpace - { - get - { - return LazyLoad(ref _NoOverrideSpace, "@NoOverrideSpace"); - } - } + // flag for cases where step text was printing on top of the bottom continue messsage due to how a step was paginated - put in for Farley + private LazyLoad _NoOverrideSpace; + public bool NoOverrideSpace => LazyLoad(ref _NoOverrideSpace, "@NoOverrideSpace"); - // Location Adjustment of the calculated vertical position of the bottom continue message (from Location setting) - private LazyLoad _LocAdj; - public int? LocAdj - { - get - { + // Location Adjustment of the calculated vertical position of the bottom continue message (from Location setting) + private LazyLoad _LocAdj; + public int? LocAdj => LazyLoad(ref _LocAdj, "@LocAdj"); + #endregion Location - return LazyLoad(ref _LocAdj, "@LocAdj"); - } - } - #endregion Location + #region Message + private LazyLoad _RemoveBullet; + public bool RemoveBullet // C2021-024: WCN1 if bullet exists in combined tab, stop right before bullet. +=> LazyLoad(ref _RemoveBullet, "@RemoveBullet"); - #region Message - private LazyLoad _RemoveBullet; - public bool RemoveBullet // C2021-024: WCN1 if bullet exists in combined tab, stop right before bullet. - { - get - { - return LazyLoad(ref _RemoveBullet, "@RemoveBullet"); - } - } + private LazyLoad _Message; + [Category("Continue Msg")] + [DisplayName("Bottom Continue Msg")] + [Description("Bottom Continue Msg")] - private LazyLoad _Message; - [Category("Continue Msg")] - [DisplayName("Bottom Continue Msg")] - [Description("Bottom Continue Msg")] - - //the bottom continue message string - may caontain special formatting items - //- see DoBottomContinueMsg in vlnParagraph for different format settings - public string Message - { - get - { - return LazyLoad(ref _Message, "@Message"); - } - } - #endregion Message - } + //the bottom continue message string - may caontain special formatting items + //- see DoBottomContinueMsg in vlnParagraph for different format settings + public string Message => LazyLoad(ref _Message, "@Message"); + #endregion Message + } #endregion Bottom #region SectionTitle @@ -1307,20 +849,14 @@ namespace VEPROMS.CSLA.Library public SectionTitle() : base() { } #region AppendToTitle private LazyLoad _AppendToTitle; - [Category("Section Title Continue Msg")] - [DisplayName("AppendToTitle")] - [Description("Append Text to Section Title For Continue Msg")] + [Category("Section Title Continue Msg")] + [DisplayName("AppendToTitle")] + [Description("Append Text to Section Title For Continue Msg")] - // continue message to add to the section title - public string AppendToTitle - { - get - { - return LazyLoad(ref _AppendToTitle, "@AppendToTitle"); - } - } - #endregion AppendToTitle - } + // continue message to add to the section title + public string AppendToTitle => LazyLoad(ref _AppendToTitle, "@AppendToTitle"); + #endregion AppendToTitle + } #endregion //SectionTitle - continue setting #endregion ContinueAll @@ -1332,19 +868,13 @@ namespace VEPROMS.CSLA.Library public End() : base() { } #region Font private VE_Font _Font; - [Category("End Msg")] - [DisplayName("Font")] - [Description("Font")] - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(XmlNode) : _Font); - } - } - #endregion - #region Flag - private LazyLoad _Flag; + [Category("End Msg")] + [DisplayName("Font")] + [Description("Font")] + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); + #endregion + #region Flag + private LazyLoad _Flag; [Category("End Msg")] [DisplayName("End Msg Exists")] [Description("End Msg Exists")] @@ -1361,48 +891,24 @@ namespace VEPROMS.CSLA.Library #region Message private LazyLoad _Message; - [Category("End Msg")] - [DisplayName("End Message")] - [Description("End Message")] + [Category("End Msg")] + [DisplayName("End Message")] + [Description("End Message")] - // End Message Text - public string Message - { - get - { - return LazyLoad(ref _Message, "@Message"); - } - } + // End Message Text + public string Message => LazyLoad(ref _Message, "@Message"); - public string FixedMessage - { - get - { - return Message == null ? null : Message.Replace("\n","\r\n").Replace(@"{par}","\r\n"); - } - } + public string FixedMessage => Message?.Replace("\n", "\r\n").Replace(@"{par}", "\r\n"); - // amount of space from the left margin to print the End Message - private LazyLoad _Margin; - public float? Margin - { - get - { - return LazyLoad(ref _Margin, "@Margin"); - } - } + // amount of space from the left margin to print the End Message + private LazyLoad _Margin; + public float? Margin => LazyLoad(ref _Margin, "@Margin"); - // print the end message at the end of each sub-section - private LazyLoad _EndMessageOnEachSubSection; - public bool EndMessageOnEachSubSection - { - get - { - return LazyLoad(ref _EndMessageOnEachSubSection, "@EndMessageOnEachSubSection"); - } - } - #endregion Message - } + // print the end message at the end of each sub-section + private LazyLoad _EndMessageOnEachSubSection; + public bool EndMessageOnEachSubSection => LazyLoad(ref _EndMessageOnEachSubSection, "@EndMessageOnEachSubSection"); + #endregion Message + } #endregion End #region Final @@ -1412,19 +918,13 @@ namespace VEPROMS.CSLA.Library public Final(XmlNode xmlNode) : base(xmlNode) { } public Final() : base() { } private LazyLoad _Message; - [Category("Final Msg")] - [DisplayName("Final Message")] - [Description("Final Message")] - - // Final Message text to be printed on last page of procedure - public string Message - { - get - { - return LazyLoad(ref _Message, "@Message"); - } - } - } + [Category("Final Msg")] + [DisplayName("Final Message")] + [Description("Final Message")] + + // Final Message text to be printed on last page of procedure + public string Message => LazyLoad(ref _Message, "@Message"); + } #endregion Final #region StructureStyle @@ -1438,36 +938,24 @@ namespace VEPROMS.CSLA.Library [Description("Where Used")] private LazyLoad _Where; - // where with repect to the section is this DocStyle/PageList relationship used: - // UseOnAllPages (all pages of the section), UseOnFirstPage (only the first page of the section), - // UseOnAllButFirstPage (all except for the first page of the section). - // Note that when UseOnFirstPage is used, it but reference a DocStyle (IndexOtherThanFirstPage) - // that uses UseOnAllButFirstPage. + // where with repect to the section is this DocStyle/PageList relationship used: + // UseOnAllPages (all pages of the section), UseOnFirstPage (only the first page of the section), + // UseOnAllButFirstPage (all except for the first page of the section). + // Note that when UseOnFirstPage is used, it but reference a DocStyle (IndexOtherThanFirstPage) + // that uses UseOnAllButFirstPage. - public E_DocStyleUse? Where - { - get - { - return LazyLoad(ref _Where, "@Where"); - } - } - #endregion Where + public E_DocStyleUse? Where => LazyLoad(ref _Where, "@Where"); + #endregion Where - #region Style - [Category("Structure Style")] + #region Style + [Category("Structure Style")] [Description("Style")] // allow us to identify a specialized type of section (Table of Contents, Foldout Page, etc) as well as other unique formatting that deviates from the normal formatting/data entry of the procedure. See "E_DocStructStyle" in VEPROMS.CSLA.Library\ENums.cs for alist of the possible flags and descriptions. private LazyLoad _Style; - public E_DocStructStyle? Style - { - get - { - return LazyLoad(ref _Style, "@Style"); - } - } - #endregion Style - } + public E_DocStructStyle? Style => LazyLoad(ref _Style, "@Style"); + #endregion Style + } #endregion StructureStyle #endregion DocStyleAll } diff --git a/PROMS/VEPROMS.CSLA.Library/Format/ENums.cs b/PROMS/VEPROMS.CSLA.Library/Format/ENums.cs index 5d0a9ff5..2653103b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/ENums.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/ENums.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; -using System.Xml; -using System.ComponentModel; namespace VEPROMS.CSLA.Library { diff --git a/PROMS/VEPROMS.CSLA.Library/Format/EPFormatFile.cs b/PROMS/VEPROMS.CSLA.Library/Format/EPFormatFile.cs index 1d75f875..d881cdc9 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/EPFormatFile.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/EPFormatFile.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.ComponentModel; using System.Xml; using System.Linq; @@ -32,54 +31,27 @@ namespace VEPROMS.CSLA.Library private LazyLoad _Name; [DisplayName("Name")] [Description("EP Viewer File Name")] - public string Name - { - get - { - return LazyLoad(ref _Name, "@Name"); - } - } + public string Name => LazyLoad(ref _Name, "@Name"); // Name of the EP Viewer Format File private LazyLoad _Description; [DisplayName("Description")] [Description("EP Viewer Description")] - public string Description - { - get - { - return LazyLoad(ref _Description, "@Description"); - } - } + public string Description => LazyLoad(ref _Description, "@Description"); // Id of Annotation Type Associated with this file private LazyLoad _AnnotationTypeID; [DisplayName("AnnotationTypeID")] [Description("Id of Annotation Type Associated with this file")] - public int? AnnotationTypeID - { - get - { - return LazyLoad(ref _AnnotationTypeID, "@AnnotationTypeID"); - } - } + public int? AnnotationTypeID => LazyLoad(ref _AnnotationTypeID, "@AnnotationTypeID"); // Return Name of Annotation that EP Format File is Attached to - public string AnnotationName() - { - return AnnotationTypeInfo.Get((int) AnnotationTypeID).Name; - } + public string AnnotationName() => AnnotationTypeInfo.Get((int)AnnotationTypeID).Name; //if xml value is blank, should element export? //defaults to true private LazyLoad _exportblank; [DisplayName("exportblank")] [Description("if xml value is blank, should element export?")] - public bool exportblank - { - get - { - return LazyLoad(ref _exportblank, "@exportblank"); - } - } + public bool exportblank => LazyLoad(ref _exportblank, "@exportblank"); // returns a list of fields that are defined in the EP format's structure private EPFields _FieldList; public EPFields FieldList @@ -141,8 +113,10 @@ namespace VEPROMS.CSLA.Library { if (dr.Read()) { - XmlDocument xd = new XmlDocument(); - xd.XmlResolver = null; + XmlDocument xd = new XmlDocument + { + XmlResolver = null + }; xd.LoadXml(dr.GetString("Data")); return xd; } @@ -255,21 +229,9 @@ namespace VEPROMS.CSLA.Library public EPField(XmlNode xmlNode) : base(xmlNode) { } public EPField() : base() { } private LazyLoad _name; - public string name - { - get - { - return LazyLoad(ref _name, "@name"); - } - } + public string name => LazyLoad(ref _name, "@name"); private LazyLoad _type; - public string type - { - get - { - return LazyLoad(ref _type, "@type"); - } - } + public string type => LazyLoad(ref _type, "@type"); private LazyLoad _label; public string label { @@ -284,22 +246,10 @@ namespace VEPROMS.CSLA.Library } } private LazyLoad _text; - public string text - { - get - { - return LazyLoad(ref _text, "@text"); - } - } + public string text => LazyLoad(ref _text, "@text"); //roid of group item that individual sub-items will be the choices for the list/combobox for ROSINGLE and ROMULTI private LazyLoad _rosource; - public string rosource - { - get - { - return LazyLoad(ref _rosource, "@rosource"); - } - } + public string rosource => LazyLoad(ref _rosource, "@rosource"); //the columns in the RO that will be included in the exports private LazyLoad _returncols; public List returncols() diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PageStyles.cs b/PROMS/VEPROMS.CSLA.Library/Format/PageStyles.cs index a97edf71..7de782d0 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PageStyles.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PageStyles.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; using System.ComponentModel; using System.Xml; @@ -23,44 +20,23 @@ namespace VEPROMS.CSLA.Library #region Business Methods // description to associate with a DocStyle private LazyLoad _Name; - [DisplayName("Name")] - [Description("Page Style Name")] - public string Name - { - get - { - return LazyLoad(ref _Name, "@Name"); - } - } + [DisplayName("Name")] + [Description("Page Style Name")] + public string Name => LazyLoad(ref _Name, "@Name"); - // a unuque number that is referenced from the DocStyles - private LazyLoad _Index; - [DisplayName("Index")] - [Description("Page Style Index")] - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } + // a unuque number that is referenced from the DocStyles + private LazyLoad _Index; + [DisplayName("Index")] + [Description("Page Style Index")] + public int? Index => LazyLoad(ref _Index, "@Index"); - private PageItems _PageItems; - public PageItems PageItems - { - get - { - return (_PageItems == null)? _PageItems = new PageItems(SelectNodes("Item")): _PageItems; - } - } - #endregion - #region Override ToString - public override string ToString() - { - return string.Format("{0:D2} - {1}", Index, Name); - } - #endregion - } + private PageItems _PageItems; + public PageItems PageItems => _PageItems ?? (_PageItems = new PageItems(SelectNodes("Item"))); + #endregion + #region Override ToString + public override string ToString() => string.Format("{0:D2} - {1}", Index, Name); + #endregion + } #endregion #region PageItems [TypeConverter(typeof(vlnListConverter))] @@ -79,192 +55,91 @@ namespace VEPROMS.CSLA.Library #endregion #region Business Methods private VE_Font _Font; - [Category("Font")] - [DisplayName("Font")] - [Description("Font")] - public VE_Font Font - { - get - { - return (_Font == null) ?_Font = new VE_Font(XmlNode): _Font; - } - } - private RelatedItem _RelatedItem; - public RelatedItem RelatedItem - { - get - { - return (_RelatedItem == null) ? _RelatedItem = new RelatedItem(SelectSingleNode("RelatedItem")) : _RelatedItem; - } - } + [Category("Font")] + [DisplayName("Font")] + [Description("Font")] + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); + private RelatedItem _RelatedItem; + public RelatedItem RelatedItem => _RelatedItem ?? (_RelatedItem = new RelatedItem(SelectSingleNode("RelatedItem"))); - // this can be an actual token, in curly braces, that dynamically gets replaced with information, or just plain text - private LazyLoad _Token; - [Category("Content")] - [DisplayName("Content")] - [Description("Item Content")] - public string Token - { - get - { - return LazyLoad(ref _Token, "@Token"); - } - } + // this can be an actual token, in curly braces, that dynamically gets replaced with information, or just plain text + private LazyLoad _Token; + [Category("Content")] + [DisplayName("Content")] + [Description("Item Content")] + public string Token => LazyLoad(ref _Token, "@Token"); - // the row on the page to place the Item - private LazyLoad _Row; - [Category("Location")] - [DisplayName("Vertical Position")] - [Description("Vertical Position")] - public float? Row - { - get - { - return LazyLoad(ref _Row, "@Row"); - } - } + // the row on the page to place the Item + private LazyLoad _Row; + [Category("Location")] + [DisplayName("Vertical Position")] + [Description("Vertical Position")] + public float? Row => LazyLoad(ref _Row, "@Row"); - // the column on the page to place the Item - private LazyLoad _Col; - [Category("Location")] - [DisplayName("Horizontal Position")] - [Description("Horizontal Position")] - public float? Col - { - get - { - return LazyLoad(ref _Col, "@Col"); - } - } + // the column on the page to place the Item + private LazyLoad _Col; + [Category("Location")] + [DisplayName("Horizontal Position")] + [Description("Horizontal Position")] + public float? Col => LazyLoad(ref _Col, "@Col"); - // the justification at the Col position in which to print the Token information - private LazyLoad _Justify; - public E_Justify? Justify - { - get - { - return LazyLoad(ref _Justify, "@Justify"); - } - } + // the justification at the Col position in which to print the Token information + private LazyLoad _Justify; + public E_Justify? Justify => LazyLoad(ref _Justify, "@Justify"); - //run the PROMS Replace Words logic on the resulting text of Token - private LazyLoad _RepWords; // F2021-053: Do replace words in page list - public bool RepWords - { - get - { - return LazyLoad(ref _RepWords, "@RepWords"); - } - } + //run the PROMS Replace Words logic on the resulting text of Token + private LazyLoad _RepWords; // F2021-053: Do replace words in page list + public bool RepWords => LazyLoad(ref _RepWords, "@RepWords"); - //Flag to tell PROMS to get the alarm value information based on the specified Child applicability - private LazyLoad _ROLkUpMatch; // C2021-065 (BNPP Alarms format) - public bool ROLkUpMatch - { - get - { - return LazyLoad(ref _ROLkUpMatch, "@ROLkUpMatch"); - } - } + //Flag to tell PROMS to get the alarm value information based on the specified Child applicability + private LazyLoad _ROLkUpMatch; // C2021-065 (BNPP Alarms format) + public bool ROLkUpMatch => LazyLoad(ref _ROLkUpMatch, "@ROLkUpMatch"); - // Flag to specify if that PageStyle Item should be used in creating alarm point information - // for viewing in the PROMS step editor - // this information is displayed in a Note that it build on the fly when first opening an Alarm Point page - private LazyLoad _ROLkUpInEditor; // C2021-018 (BNPP Alarms format) - public bool ROLkUpInEditor - { - get - { - return LazyLoad(ref _ROLkUpInEditor, "@ROLkUpInEditor"); - } - } + // Flag to specify if that PageStyle Item should be used in creating alarm point information + // for viewing in the PROMS step editor + // this information is displayed in a Note that it build on the fly when first opening an Alarm Point page + private LazyLoad _ROLkUpInEditor; // C2021-018 (BNPP Alarms format) + public bool ROLkUpInEditor => LazyLoad(ref _ROLkUpInEditor, "@ROLkUpInEditor"); - // defines a maxium width before the resolved PSI token (procedure specific information) text is wrapped - // on to the next line - private LazyLoad _MaxWidth; - public int? MaxWidth - { - get - { - return (LazyLoad(ref _MaxWidth, "@MaxWidth")); - } - } + // defines a maxium width before the resolved PSI token (procedure specific information) text is wrapped + // on to the next line + private LazyLoad _MaxWidth; + public int? MaxWidth => LazyLoad(ref _MaxWidth, "@MaxWidth"); - // MaxWidth, above, flagged that, if there was more than 1 line, the topmargin would be adjusted by however - // many lines the PSI item contained (for wst alarms). The MaxWidthCurPage is used when that adjustment - // should not be made, the length of the PSI item is only relevant for the current page. - // (see AdjustTopMarginForMultiLinePageListItems variable and how it is used) - private LazyLoad _MaxWidthCurPage; - public int? MaxWidthCurPage - { - get - { - return (LazyLoad(ref _MaxWidthCurPage, "@MaxWidthCurPage")); - } - } + // MaxWidth, above, flagged that, if there was more than 1 line, the topmargin would be adjusted by however + // many lines the PSI item contained (for wst alarms). The MaxWidthCurPage is used when that adjustment + // should not be made, the length of the PSI item is only relevant for the current page. + // (see AdjustTopMarginForMultiLinePageListItems variable and how it is used) + private LazyLoad _MaxWidthCurPage; + public int? MaxWidthCurPage => LazyLoad(ref _MaxWidthCurPage, "@MaxWidthCurPage"); - // the resolved pagestype item font size will be reduce in order to fit within the defined width - private LazyLoad _FontShrinkAftLen; // F2021-066 & 070 (text len before shrinking font) - public int? FontShrinkAftLen - { - get - { - return (LazyLoad(ref _FontShrinkAftLen, "@FontShrinkAftLen")); - } - } + // the resolved pagestype item font size will be reduce in order to fit within the defined width + private LazyLoad _FontShrinkAftLen; // F2021-066 & 070 (text len before shrinking font) + public int? FontShrinkAftLen => LazyLoad(ref _FontShrinkAftLen, "@FontShrinkAftLen"); - // used in Alarm Point Table page style values with FontShrinkAftLen set, will display this message if the text cannot be shrunk enough (and be readable) to fit within the defined width - private LazyLoad _FontTooSmallMsg; // F2021-066 message if can't shrink enough - public string FontTooSmallMsg - { - get - { - return LazyLoad(ref _FontTooSmallMsg, "@FontTooSmallMsg"); - } - } + // used in Alarm Point Table page style values with FontShrinkAftLen set, will display this message if the text cannot be shrunk enough (and be readable) to fit within the defined width + private LazyLoad _FontTooSmallMsg; // F2021-066 message if can't shrink enough + public string FontTooSmallMsg => LazyLoad(ref _FontTooSmallMsg, "@FontTooSmallMsg"); - // F2023-039 allow to select text color of a pagelist line - // sets a text color for the page style Item - private LazyLoad _TextColor; - public string TextColor - { - get - { - return LazyLoad(ref _TextColor, "@TextColor"); - } - } + // F2023-039 allow to select text color of a pagelist line + // sets a text color for the page style Item + private LazyLoad _TextColor; + public string TextColor => LazyLoad(ref _TextColor, "@TextColor"); - // set to a string, will remove the matching string from the end - // F2023-112 Vogtle Units 3 & Backgrounds - trim the ending "-B" from the procedure number (used in title box of page header) - private LazyLoad _TrimEnding; - public string TrimEnding - { - get - { - return LazyLoad(ref _TrimEnding, "@TrimEnding"); - } - } - // C2025-033 to specify to print pagestyle item for a specific Child procedure - private LazyLoad _ChildNum; - public int? ChildNum - { - get - { - return (LazyLoad(ref _ChildNum, "@ChildNum")); - } - } + // set to a string, will remove the matching string from the end + // F2023-112 Vogtle Units 3 & Backgrounds - trim the ending "-B" from the procedure number (used in title box of page header) + private LazyLoad _TrimEnding; + public string TrimEnding => LazyLoad(ref _TrimEnding, "@TrimEnding"); + // C2025-033 to specify to print pagestyle item for a specific Child procedure + private LazyLoad _ChildNum; + public int? ChildNum => LazyLoad(ref _ChildNum, "@ChildNum"); - #endregion - #region Override ToString - public override string ToString() - { - //return string.Format("({0:D5},{1:D5}) - {2}",Row,Col,Token); - return Token; - } - public override string GetPDDisplayName() - { return string.Format("({0},{1})",Row,Col); } - #endregion - } + #endregion + #region Override ToString + public override string ToString() => Token; + public override string GetPDDisplayName() => string.Format("({0},{1})", Row, Col); + #endregion + } #endregion #region RelatedItem // RelatedItem was added to allow a PSI logical to have an associated PSI item, and if both are @@ -281,53 +156,29 @@ namespace VEPROMS.CSLA.Library // the name of the PSI logical token to check private LazyLoad _Token; - [Category("RelatedContent")] - [DisplayName("RelatedContent")] - [Description("Item RelatedContent")] - public string Token - { - get - { - return LazyLoad(ref _Token, "@Token"); - } - } + [Category("RelatedContent")] + [DisplayName("RelatedContent")] + [Description("Item RelatedContent")] + public string Token => LazyLoad(ref _Token, "@Token"); - // new Row value to use for PageStyle Item - private LazyLoad _Row; - [Category("Location")] - [DisplayName("Vertical Position")] - [Description("Vertical Position")] - public float? Row - { - get - { - return LazyLoad(ref _Row, "@Row"); - } - } + // new Row value to use for PageStyle Item + private LazyLoad _Row; + [Category("Location")] + [DisplayName("Vertical Position")] + [Description("Vertical Position")] + public float? Row => LazyLoad(ref _Row, "@Row"); - // new Col value to use for PageStyle Item - private LazyLoad _Col; - [Category("Location")] - [DisplayName("Horizontal Position")] - [Description("Horizontal Position")] - public float? Col - { - get - { - return LazyLoad(ref _Col, "@Col"); - } - } + // new Col value to use for PageStyle Item + private LazyLoad _Col; + [Category("Location")] + [DisplayName("Horizontal Position")] + [Description("Horizontal Position")] + public float? Col => LazyLoad(ref _Col, "@Col"); - // new Justify value to use for PageStyle Item - private LazyLoad _Justify; - public E_Justify? Justify - { - get - { - return LazyLoad(ref _Justify, "@Justify"); - } - } - #endregion - } + // new Justify value to use for PageStyle Item + private LazyLoad _Justify; + public E_Justify? Justify => LazyLoad(ref _Justify, "@Justify"); + #endregion + } #endregion } diff --git a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs index 36631cf5..28704379 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/PlantFormat.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Text; using System.Xml; using System.ComponentModel; using System.Drawing; @@ -11,9 +10,10 @@ namespace VEPROMS.CSLA.Library [TypeConverter(typeof(ExpandableObjectConverter))] public class PlantFormat { - public PlantFormat(IFormatOrFormatInfo format, string config) + [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping config for future use / Debugging")] + public PlantFormat(IFormatOrFormatInfo format, string config) { - _MyFormat = format; + MyFormat = format; string str = null; if (format is Format) str = (format as Format).Config; else if (format is FormatInfo) str = (format as FormatInfo).Config; @@ -26,26 +26,21 @@ namespace VEPROMS.CSLA.Library { if (_FormatConfig == null) { - _FormatConfig = GetFormatConfig(_MyFormat); + _FormatConfig = GetFormatConfig(MyFormat); } return _FormatConfig; } set { _FormatConfig = value; } } - #region User Control of Format (UCF) - // User Control of Format allows a PROMS user to make modifications to a very limited set of format settings - // Variables in this region are not set in the format files. They are used only in the C# code + #region User Control of Format (UCF) + // User Control of Format allows a PROMS user to make modifications to a very limited set of format settings + // Variables in this region are not set in the format files. They are used only in the C# code - // when IgnoreUCF is true, get the original data, i.e.don't apply any UCF changes to it - private static bool _IgnoreUCF = true; // turn off reading in UCF values when getting format information - public static bool IgnoreUCF - { - get { return PlantFormat._IgnoreUCF; } - set { PlantFormat._IgnoreUCF = value; } - } + // when IgnoreUCF is true, get the original data, i.e.don't apply any UCF changes to it + public static bool IgnoreUCF { get; set; } = true; - #endregion //User Control of Format (UCF) - public static FormatConfig GetFormatConfig(IFormatOrFormatInfo format) + #endregion //User Control of Format (UCF) + public static FormatConfig GetFormatConfig(IFormatOrFormatInfo format) { FormatConfig fc = null; string str = null; @@ -54,19 +49,15 @@ namespace VEPROMS.CSLA.Library if (str != null && str != "") fc = FormatConfig.Get(str); return fc; } - private IFormatOrFormatInfo _MyFormat; - public IFormatOrFormatInfo MyFormat - { - get { return _MyFormat; } - set { _MyFormat = value; } - } - private vlnFormatDocument _XmlDoc; + + public IFormatOrFormatInfo MyFormat { get; set; } + private vlnFormatDocument _XmlDoc; internal vlnFormatDocument XmlDoc { get { if (_XmlDoc == null) - _XmlDoc = new vlnFormatDocument(_MyFormat); + _XmlDoc = new vlnFormatDocument(MyFormat); return _XmlDoc; } } @@ -132,10 +123,10 @@ namespace VEPROMS.CSLA.Library public class VE_Font : vlnFormatItem { public VE_Font(XmlNode xmlNode) : base(xmlNode) { } - private string _ffam = null; - private int _fsize = 0; - private E_Style _fstyle = E_Style.None; - private float _fcpi = 0; + private readonly string _ffam = null; + private readonly int _fsize = 0; + private readonly E_Style _fstyle = E_Style.None; + private readonly float _fcpi = 0; public VE_Font(string family, int size, E_Style style, float CPI) { _Family = new LazyLoad(family); @@ -148,7 +139,8 @@ namespace VEPROMS.CSLA.Library _fcpi = CPI; } private LazyLoad _Family; - private static Dictionary _WinFontLookup = new Dictionary(); + [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")] + private static Dictionary _WinFontLookup = new Dictionary(); // put the fonts in a dictionary so that we don't call new Font each time we reference it private static Font GetFont(string family, float size, FontStyle style) { @@ -157,34 +149,21 @@ namespace VEPROMS.CSLA.Library _WinFontLookup.Add(key, new Font(family, size, style)); return _WinFontLookup[key]; } - // part of bug B2017-117 and for conservation of window handles to reduce the frequency of - // the Out of Window Handles error when editing and printing. - // we are now using a common dictionary for font usages - public static Font GetWinSysFont(string family, float size, FontStyle style) - { - return GetFont(family, size, style); - } - public static Font GetWinSysFont(string family, float size) - { - return GetFont(family, size, FontStyle.Regular); - } - public static Font GetWinSysFont(FontFamily ffamily, float size, FontStyle style) - { - return GetFont(ffamily.Name, size, style); - } - public static Font GetWinSysFont(Font font, FontStyle style) - { - return GetFont(font.Name, font.Size, style); - } + // part of bug B2017-117 and for conservation of window handles to reduce the frequency of + // the Out of Window Handles error when editing and printing. + // we are now using a common dictionary for font usages + public static Font GetWinSysFont(string family, float size, FontStyle style) => GetFont(family, size, style); + public static Font GetWinSysFont(string family, float size) => GetFont(family, size, FontStyle.Regular); + public static Font GetWinSysFont(FontFamily ffamily, float size, FontStyle style) => GetFont(ffamily.Name, size, style); + public static Font GetWinSysFont(Font font, FontStyle style) => GetFont(font.Name, font.Size, style); - private Font _WindowsFont; + private Font _WindowsFont; public Font WindowsFont { get { if (_WindowsFont == null) { - //FontStyle style = (Family == "Cornet")?FontStyle.Italic : FontStyle.Regular; FontStyle style = FontStyle.Regular; if (Style != E_Style.None) { @@ -200,10 +179,7 @@ namespace VEPROMS.CSLA.Library _WindowsFont = GetFont("Arial", 10, FontStyle.Regular); else { - //if (_ffam != null) - // _WindowsFont = GetFont(_ffam, (float)_fsize, style); // this needs work. - //else - _WindowsFont = GetFont(Family, Size == 0 ? 10 : (float)Size, style); + _WindowsFont = GetFont(Family, Size == 0 ? 10 : (float)Size, style); } } return _WindowsFont; @@ -213,61 +189,19 @@ namespace VEPROMS.CSLA.Library _WindowsFont = value; } } - [Description("Font Family")] - public string Family - { - get - { - return LazyLoad(ref _Family,"Font/@Family"); - } - } - private LazyLoad _Size; - [Description("Font Size (in Double Points)")] - public int? Size - { - get - { - return LazyLoad(ref _Size, "Font/@Size"); - } - } - private LazyLoad _Style; - public E_Style? Style - { - get - { - return LazyLoad(ref _Style, "Font/@Style"); - } - //set - //{ - // _Style.Value = value; - //} - } - private LazyLoad _CPI; - public float? CPI - { - get - { - return LazyLoad(ref _CPI, "Font/@CPI"); - } - } - public float CharsToTwips - { - get - { - return (72 / (CPI ?? 12)); - } - - } - public override string ToString() - { - return string.Format("{0}, {1} pt, {2}", Family, Size, Style); - } - public bool FontIsProportional() - { - if (Family.Contains("Arial") || Family.Contains("Times New Roman")) return true; - return false; - } - } + [Description("Font Family")] + public string Family => LazyLoad(ref _Family, "Font/@Family"); + private LazyLoad _Size; + [Description("Font Size (in Double Points)")] + public int? Size => LazyLoad(ref _Size, "Font/@Size"); + private LazyLoad _Style; + public E_Style? Style => LazyLoad(ref _Style, "Font/@Style"); + private LazyLoad _CPI; + public float? CPI => LazyLoad(ref _CPI, "Font/@CPI"); + public float CharsToTwips => 72 / (CPI ?? 12); + public override string ToString() => string.Format("{0}, {1} pt, {2}", Family, Size, Style); + public bool FontIsProportional() => Family.Contains("Arial") || Family.Contains("Times New Roman"); + } #endregion #region FormatData [TypeConverter(typeof(ExpandableObjectConverter))] @@ -276,67 +210,31 @@ namespace VEPROMS.CSLA.Library public FormatData(XmlNode xmlNode) : base(xmlNode) { } // Name of the format - as it appears when selecting the format to use in PROMS private LazyLoad _Name; - public string Name - { - get - { - return LazyLoad(ref _Name, "@Name"); - } - } - // When true, this format is allowed to be used in the PROMS Express product - private LazyLoad _Express; - public bool Express - { - get - { - return LazyLoad(ref _Express, "@Express"); - } - } - // When set to True, it enables the use of a Procedure Set Specific dialog, containing defined fields - // in which the user enters data that is printed on all or specific pages for all of the procedures in the set using this format - private LazyLoad _SpecificInfo; - public bool SpecificInfo - { - get - { - return LazyLoad(ref _SpecificInfo, "@SpecificInfo"); - } - } - // this is a structure defined in the format file that defines labels and fields on a pop-up dialog - // in which the user will enter data - this is accessible only at the procedure set level - private SI _SI; - public SI SI - { - get - { - return _SI == null ? _SI = new SI(SelectSingleNode("SI")) : _SI; - } - } - // TPL represents Templates which are sizes of columns for 'table' type data. If the format - // has the 'UseSmartTemplate' format flag, this table will have starting location & widths, and - // other data for the listed step types. Data from this table overrides width data as specified - // by the step type format data. The only active format that has 'UseSmartTemplate' is WCNCKL. - // The TPL data is also used by other formats, many of which are using it for Enhanced Background - // & Deviations. The actual format of the template can be in an old or new format. The old format - // uses spaces as delimiters, the new uses commas. - private LazyLoad _TPL; - public string TPL - { - get - { - return LazyLoad(ref _TPL, "@TPL"); - } - } - // not defined in format files, we now use TPL to define both the original and new template - // the C# determines if it's a smart (new) template or the old style (search for NewTemplateFormat to see the code) - private bool _NewTemplateFormat; - public bool NewTemplateFormat - { - get { return _NewTemplateFormat; } - set { _NewTemplateFormat = value; } - } - // Creates a dictionary of the templates (TPL) defined in the format - private Dictionary _TopTemplateTypes; + public string Name => LazyLoad(ref _Name, "@Name"); + // When true, this format is allowed to be used in the PROMS Express product + private LazyLoad _Express; + public bool Express => LazyLoad(ref _Express, "@Express"); + // When set to True, it enables the use of a Procedure Set Specific dialog, containing defined fields + // in which the user enters data that is printed on all or specific pages for all of the procedures in the set using this format + private LazyLoad _SpecificInfo; + public bool SpecificInfo => LazyLoad(ref _SpecificInfo, "@SpecificInfo"); + // this is a structure defined in the format file that defines labels and fields on a pop-up dialog + // in which the user will enter data - this is accessible only at the procedure set level + private SI _SI; + public SI SI => _SI ?? (_SI = new SI(SelectSingleNode("SI"))); + // TPL represents Templates which are sizes of columns for 'table' type data. If the format + // has the 'UseSmartTemplate' format flag, this table will have starting location & widths, and + // other data for the listed step types. Data from this table overrides width data as specified + // by the step type format data. The only active format that has 'UseSmartTemplate' is WCNCKL. + // The TPL data is also used by other formats, many of which are using it for Enhanced Background + // & Deviations. The actual format of the template can be in an old or new format. The old format + // uses spaces as delimiters, the new uses commas. + private LazyLoad _TPL; + public string TPL => LazyLoad(ref _TPL, "@TPL"); + + public bool NewTemplateFormat { get; set; } + // Creates a dictionary of the templates (TPL) defined in the format + private Dictionary _TopTemplateTypes; public Dictionary TopTemplateTypes { get @@ -387,64 +285,63 @@ namespace VEPROMS.CSLA.Library int cnt = 0; int tmpStrIndxStart = 0; - int tmpStrIndxEnd = 0; - while (cnt < NumTemplates) + while (cnt < NumTemplates) { - tmpStrIndxEnd = TPL.IndexOf("\n", tmpStrIndxStart); - if (tmpStrIndxEnd < 0) + int tmpStrIndxEnd = TPL.IndexOf("\n", tmpStrIndxStart); + if (tmpStrIndxEnd < 0) { cnt++; continue; // maybe extra newlines at end of string. } string tpl = TPL.Substring(tmpStrIndxStart, tmpStrIndxEnd-tmpStrIndxStart); tmpStrIndxStart = tmpStrIndxEnd + 1; - int level = 0; - int type = 0; - int start = 0; - int width = 0; + int start = 0; + int width = 0; short nocol = 0; int row = 0; - string stmp = null; - if (!NewTemplateFormat) // not the smart template - { - string[] tmpOld = tpl.Split(" ".ToCharArray()); - level = Convert.ToInt32(tmpOld[0]); - type = Convert.ToInt32(tmpOld[1]); - if (tmpOld.Length <= 2) - stmp = null; - else if (tmpOld.Length > 3) - { - // Wolf Creek and Turkey Point Background formats have spaces as part of the text in the 3rd field, - // handle this special case - int indxx = tpl.IndexOf(" "); //skip past "level" - if (indxx < 0) stmp = null; // template incomplete set text to a null - else - { - indxx = tpl.IndexOf(" ", indxx + 1); //skip past "type" - stmp = (indxx > -1) ? tpl.Substring(indxx+1) : null; //if valid index grab text after "type" (+1 skips past the space char after the "type" number) - } - } - else - stmp = tmpOld[2]; - } - else - { - string[] tmpNew = tpl.Split(",".ToCharArray()); - if (tmpNew.Length < 5) - { - cnt++; - continue; // may be extra newlines at end of string - } - level = Convert.ToInt32(tmpNew[0]); - type = Convert.ToInt32(tmpNew[1]); - start = Convert.ToInt32(tmpNew[2]); - width = Convert.ToInt32(tmpNew[3]); - row = Convert.ToInt32(tmpNew[4]); - nocol = Convert.ToInt16(tmpNew[5]); - stmp = tmpNew.Length <= 6 ? null : tmpNew[6]; - } - // some plants (Wolf Creek, Turkey Point) have two line titles in their templates with "[(0014])" representing the hard return in the title - if (stmp != null) + int level; + int type; + string stmp; + if (!NewTemplateFormat) // not the smart template + { + string[] tmpOld = tpl.Split(" ".ToCharArray()); + level = Convert.ToInt32(tmpOld[0]); + type = Convert.ToInt32(tmpOld[1]); + if (tmpOld.Length <= 2) + stmp = null; + else if (tmpOld.Length > 3) + { + // Wolf Creek and Turkey Point Background formats have spaces as part of the text in the 3rd field, + // handle this special case + int indxx = tpl.IndexOf(" "); //skip past "level" + if (indxx < 0) stmp = null; // template incomplete set text to a null + else + { + indxx = tpl.IndexOf(" ", indxx + 1); //skip past "type" + stmp = (indxx > -1) ? tpl.Substring(indxx + 1) : null; //if valid index grab text after "type" (+1 skips past the space char after the "type" number) + } + } + else + stmp = tmpOld[2]; + } + else + { + string[] tmpNew = tpl.Split(",".ToCharArray()); + if (tmpNew.Length < 5) + { + cnt++; + continue; // may be extra newlines at end of string + } + level = Convert.ToInt32(tmpNew[0]); + type = Convert.ToInt32(tmpNew[1]); + start = Convert.ToInt32(tmpNew[2]); + width = Convert.ToInt32(tmpNew[3]); + row = Convert.ToInt32(tmpNew[4]); + nocol = Convert.ToInt16(tmpNew[5]); + stmp = tmpNew.Length <= 6 ? null : tmpNew[6]; + } + // some plants (Wolf Creek, Turkey Point) have two line titles in their templates with "[(0014])" representing the hard return in the title + if (stmp != null) { stmp = stmp.Replace("[(0014])", "\\line "); // Hard Return stmp = stmp.Replace("\xFFFD", @"\u160?"); // Hard Space B2018-052 replace old(from 16-bit) hardspace character with the unicode hardspace character @@ -462,49 +359,26 @@ namespace VEPROMS.CSLA.Library // where we check which bits of the integer is set to determine if that option can be used. // See E_PurchaseOptions in ENums.cs for a description of each option flag (bit) private LazyLoad _PurchaseOptions; - public E_PurchaseOptions? PurchaseOptions - { - get - { - return LazyLoad(ref _PurchaseOptions, "@PurchaseOptions"); - } - } - // Set at the top of the format(under FormatData) defined the default font used in this format. - // Specific step types can have different font information assigned to override this default - private VE_Font _Font; - public VE_Font Font - { - get - { - return _Font == null? _Font = new VE_Font(base.XmlNode): _Font; - } - } + public E_PurchaseOptions? PurchaseOptions => LazyLoad(ref _PurchaseOptions, "@PurchaseOptions"); + // Set at the top of the format(under FormatData) defined the default font used in this format. + // Specific step types can have different font information assigned to override this default + private VE_Font _Font; + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); - // Defines the printed page size (ex: US Letter, A4) - private PDFPageSize _PDFPageSize; - public PDFPageSize PDFPageSize // C2020-002 paper size is now set in the format files - { - get - { - return _PDFPageSize == null ? _PDFPageSize = new PDFPageSize(SelectSingleNode("PDFPageSize")) : _PDFPageSize; - } - } - //C2021-005 Format file grouping containing a list of possible font sizes (used only for table text via the Table Ribbon) - private FontSizes _FontSizes; - public FontSizes FontSizes - { - get - { - return _FontSizes == null ? _FontSizes = new FontSizes(SelectSingleNode("FontSizes")) : _FontSizes; - } - } - // C2021-004 This gets the list for additional Table Cell shading options defined in the format (base) file - private ShadingOptionList _ShadingOptionList; + // Defines the printed page size (ex: US Letter, A4) + private PDFPageSize _PDFPageSize; + // C2020-002 paper size is now set in the format files + public PDFPageSize PDFPageSize => _PDFPageSize ?? (_PDFPageSize = new PDFPageSize(SelectSingleNode("PDFPageSize"))); + //C2021-005 Format file grouping containing a list of possible font sizes (used only for table text via the Table Ribbon) + private FontSizes _FontSizes; + public FontSizes FontSizes => _FontSizes ?? (_FontSizes = new FontSizes(SelectSingleNode("FontSizes"))); + // C2021-004 This gets the list for additional Table Cell shading options defined in the format (base) file + private ShadingOptionList _ShadingOptionList; public ShadingOptionList ShadingOptionList { get { - return (_ShadingOptionList == null) ? _ShadingOptionList = new ShadingOptionList(SelectNodes("MoreShadingOptions/ShadingOption")) : _ShadingOptionList; + return _ShadingOptionList ?? (_ShadingOptionList = new ShadingOptionList(SelectNodes("MoreShadingOptions/ShadingOption"))); } set { _ShadingOptionList = value; } } @@ -514,7 +388,7 @@ namespace VEPROMS.CSLA.Library { get { - return (_UnitWatermarkList == null) ? _UnitWatermarkList = new UnitWatermarkList(SelectNodes("UnitWatermarkData/UnitWatermark")) : _UnitWatermarkList; + return _UnitWatermarkList ?? (_UnitWatermarkList = new UnitWatermarkList(SelectNodes("UnitWatermarkData/UnitWatermark"))); } set { _UnitWatermarkList = value; } } @@ -525,81 +399,45 @@ namespace VEPROMS.CSLA.Library { get { - return (_SymbolList == null) ? _SymbolList = new SymbolList(SelectNodes("Symbols/Symbol")) : _SymbolList; + return _SymbolList ?? (_SymbolList = new SymbolList(SelectNodes("Symbols/Symbol"))); } set { _SymbolList = value; } } // gets the high level node that contains setting used in the procedure step editor private EditData _EditData; - public EditData EditData - { - get - { - return _EditData == null ? _EditData = new EditData(SelectSingleNode("EditData")): _EditData; - } - } - // gets the high level node that contains settings used to generate PDFs (print) - private PrintData _PrintData; - public PrintData PrintData - { - get - { - return _PrintData == null? _PrintData = new PrintData(SelectSingleNode("PrintData")):_PrintData; - } - } - // get high level node containing settings used for both edit and print - private ProcData _ProcData; - public ProcData ProcData - { - get - { - return _ProcData == null? _ProcData = new ProcData(SelectSingleNode("ProcData")):_ProcData; - } - } - // get high level node containing settings pertraining to sections of a procedure - private SectData _SectData; - public SectData SectData - { - get - { - return _SectData == null? _SectData = new SectData(SelectSingleNode("SectData")):_SectData; - } - } - // get a list of box formatting information primarily used for Cautions, Notes, and Warnings. - private BoxList _BoxList; + public EditData EditData => _EditData ?? (_EditData = new EditData(SelectSingleNode("EditData"))); + // gets the high level node that contains settings used to generate PDFs (print) + private PrintData _PrintData; + public PrintData PrintData => _PrintData ?? (_PrintData = new PrintData(SelectSingleNode("PrintData"))); + // get high level node containing settings used for both edit and print + private ProcData _ProcData; + public ProcData ProcData => _ProcData ?? (_ProcData = new ProcData(SelectSingleNode("ProcData"))); + // get high level node containing settings pertraining to sections of a procedure + private SectData _SectData; + public SectData SectData => _SectData ?? (_SectData = new SectData(SelectSingleNode("SectData"))); + // get a list of box formatting information primarily used for Cautions, Notes, and Warnings. + private BoxList _BoxList; public BoxList BoxList { get { - return _BoxList == null? _BoxList = new BoxList(SelectNodes("BoxData/Box"),MyFormat):_BoxList; + return _BoxList ?? (_BoxList = new BoxList(SelectNodes("BoxData/Box"), MyFormat)); } set { _BoxList = value; } } // gets a list of trainsition formatting information for various types of transitions private TransData _TransData; - public TransData TransData - { - get - { - return _TransData == null? _TransData = new TransData(SelectSingleNode("TransData")):_TransData; - } - } - // get format settings related to handling Referenced Object values - private ROData _ROData; - public ROData ROData - { - get - { - return _ROData == null ? _ROData = new ROData(SelectSingleNode("ROData")) : _ROData; - } - } - // gets a list containing all of the defined step types and step parts (high level, sub-steps, cations, notes, etc) - private StepDataList _StepDataList; + public TransData TransData => _TransData ?? (_TransData = new TransData(SelectSingleNode("TransData"))); + // get format settings related to handling Referenced Object values + private ROData _ROData; + public ROData ROData => _ROData ?? (_ROData = new ROData(SelectSingleNode("ROData"))); + // gets a list containing all of the defined step types and step parts (high level, sub-steps, cations, notes, etc) + private StepDataList _StepDataList; public StepDataList StepDataList { get { - return _StepDataList == null? _StepDataList = new StepDataList(SelectNodes("StepData/Step"),MyFormat):_StepDataList; + return _StepDataList ?? (_StepDataList = new StepDataList(SelectNodes("StepData/Step"), MyFormat)); } set { _StepDataList = value; } } @@ -649,8 +487,10 @@ namespace VEPROMS.CSLA.Library while (top.ParentType != "Base") { bool foundit = false; - string sParStp = StepDataList[formatStepType].ParentType; - foreach (StepData stp in StepDataList) +#pragma warning disable IDE0059 // Unnecessary assignment of a value - Keeping for Debugging + string sParStp = StepDataList[formatStepType].ParentType; +#pragma warning restore IDE0059 // Unnecessary assignment of a value + foreach (StepData stp in StepDataList) { if (top.ParentType == stp.Type) { @@ -865,14 +705,8 @@ namespace VEPROMS.CSLA.Library // Defines the printed page size (ex: US Letter, A4) private LazyLoad _PaperSize; - public string PaperSize - { - get - { - return LazyLoad(ref _PaperSize, "@PaperSize"); // C2020-002 paper size is now set in the format files - } - } - } + public string PaperSize => LazyLoad(ref _PaperSize, "@PaperSize"); // C2020-002 paper size is now set in the format files + } #endregion #region FontSizes // C2021-005 the list of possible font sizes are set in the format files @@ -881,14 +715,8 @@ namespace VEPROMS.CSLA.Library { public FontSizes(XmlNode xmlNode) : base(xmlNode) { } private LazyLoad _TableFontSizes; - public string TableFontSizes - { - get - { - return LazyLoad(ref _TableFontSizes, "@TableFontSizes"); // C2021-005 list of possible font sizes for table text - } - } - } + public string TableFontSizes => LazyLoad(ref _TableFontSizes, "@TableFontSizes"); // C2021-005 list of possible font sizes for table text + } #endregion #region ShadingOptions // C2021-004 Additional shading color options defined in the format file @@ -904,64 +732,25 @@ namespace VEPROMS.CSLA.Library public ShadingOption() : base() { } [Category("Ints")] private LazyLoad _Alpha; - public int? Alpha - { - get - { - return LazyLoad(ref _Alpha, "@A"); - } - } - [Category("Ints")] + public int? Alpha => LazyLoad(ref _Alpha, "@A"); + [Category("Ints")] private LazyLoad _Red; - public int? Red - { - get - { - return LazyLoad(ref _Red, "@R"); - } - } - [Category("Ints")] + public int? Red => LazyLoad(ref _Red, "@R"); + [Category("Ints")] private LazyLoad _Green; - public int? Green - { - get - { - return LazyLoad(ref _Green, "@G"); - } - } - [Category("Ints")] + public int? Green => LazyLoad(ref _Green, "@G"); + [Category("Ints")] private LazyLoad _Blue; - public int? Blue - { - get - { - return LazyLoad(ref _Blue, "@B"); - } - } - [Category("Strings")] + public int? Blue => LazyLoad(ref _Blue, "@B"); + [Category("Strings")] private LazyLoad _Desc; - public string Desc - { - get - { - return LazyLoad(ref _Desc, "@Desc"); - } - } - public override string GetPDDisplayName() - { return Desc; } - public override string GetPDDescription() - { return string.Format("Shading Description '{0}' Alpha {1} Red {2} Green {3} Blue {4}", Desc, Alpha, Red, Green, Blue); } - public override string GetPDCategory() - { return "Additional Shading Options"; } - public override string ToString() - { - return Desc; - } - public string GetARBGstringForTableCells() - { - return string.Format("[A={0}, R={1}, G={2}, B={3}]", Alpha, Red, Green, Blue); - } - } + public string Desc => LazyLoad(ref _Desc, "@Desc"); + public override string GetPDDisplayName() => Desc; + public override string GetPDDescription() => string.Format("Shading Description '{0}' Alpha {1} Red {2} Green {3} Blue {4}", Desc, Alpha, Red, Green, Blue); + public override string GetPDCategory() => "Additional Shading Options"; + public override string ToString() => Desc; + public string GetARBGstringForTableCells() => string.Format("[A={0}, R={1}, G={2}, B={3}]", Alpha, Red, Green, Blue); + } [TypeConverter(typeof(vlnListConverter))] public class ShadingOptionList : vlnFormatList { @@ -995,32 +784,15 @@ namespace VEPROMS.CSLA.Library public UnitWatermark() : base() { } [Category("Strings")] private LazyLoad _ProcNumPrefix; - public string ProcNumPrefix // based on the what the procedure number starts with, usually a resolved unit toke (ex: ) - { - get - { - return LazyLoad(ref _ProcNumPrefix, "@ProcNumPrefix"); - } - } - [Category("Strings")] + // based on the what the procedure number starts with, usually a resolved unit toke (ex: ) + public string ProcNumPrefix => LazyLoad(ref _ProcNumPrefix, "@ProcNumPrefix"); + [Category("Strings")] private LazyLoad _WMText; - public string WMText - { - get - { - return LazyLoad(ref _WMText, "@WMText"); - } - } - [Category("Strings")] + public string WMText => LazyLoad(ref _WMText, "@WMText"); + [Category("Strings")] private LazyLoad _WMColor; - public string WMColor - { - get - { - return LazyLoad(ref _WMColor, "@WMColor"); - } - } - } + public string WMColor => LazyLoad(ref _WMColor, "@WMColor"); + } [TypeConverter(typeof(vlnListConverter))] public class UnitWatermarkList : vlnFormatList { @@ -1035,33 +807,15 @@ namespace VEPROMS.CSLA.Library public Symbol() : base() { } [Category("Ints")] private LazyLoad _Unicode; - public int? Unicode - { - get - { - return LazyLoad(ref _Unicode, "@Unicode"); - } - } - [Category("Strings")] + public int? Unicode => LazyLoad(ref _Unicode, "@Unicode"); + [Category("Strings")] private LazyLoad _Desc; - public string Desc - { - get - { - return LazyLoad(ref _Desc, "@Desc"); - } - } - public override string GetPDDisplayName() - { return Desc; } - public override string GetPDDescription() - { return string.Format("Symbol Unicode '{0}' Description '{1}'", Unicode, Desc); } - public override string GetPDCategory() - { return "Supported Symbols"; } - public override string ToString() - { - return Desc; - } - } + public string Desc => LazyLoad(ref _Desc, "@Desc"); + public override string GetPDDisplayName() => Desc; + public override string GetPDDescription() => string.Format("Symbol Unicode '{0}' Description '{1}'", Unicode, Desc); + public override string GetPDCategory() => "Supported Symbols"; + public override string ToString() => Desc; + } [TypeConverter(typeof(vlnListConverter))] public class SymbolList : vlnFormatList { @@ -1096,7 +850,6 @@ namespace VEPROMS.CSLA.Library nocolm = c; hmacro = 0x00F0 & nocolm >> 4; if (hmacro > 0) hmacro = 4; // bge - this was in 16bit code - int blines = (0x0F00 & nocolm) >> 8; boxed = ((0xF000 & nocolm) >> 12) != 0; nocolm = (short)(0x000F & nocolm); text = x; @@ -1112,14 +865,8 @@ namespace VEPROMS.CSLA.Library // - No change bars will be added // - existing change bars will remain private LazyLoad _EditoralSpellCheck; - public bool EditoralSpellCheck - { - get - { - return LazyLoad(ref _EditoralSpellCheck, "@EditoralSpellCheck"); - } - } - } + public bool EditoralSpellCheck => LazyLoad(ref _EditoralSpellCheck, "@EditoralSpellCheck"); + } #endregion #region PrintDataAll #region PrintData @@ -1131,294 +878,132 @@ namespace VEPROMS.CSLA.Library // List of procedure descriptions (ProcDescr) inwhich we match the beginning of a procedure number // in order to print procedure description text via a pagelist token private ProcDescrList _ProcDescrList; - public ProcDescrList ProcDescrList - { - get - { - return _ProcDescrList == null? _ProcDescrList = new ProcDescrList(SelectNodes("ProcDescrList/ProcDescr")):_ProcDescrList; - } - } + public ProcDescrList ProcDescrList => _ProcDescrList ?? (_ProcDescrList = new ProcDescrList(SelectNodes("ProcDescrList/ProcDescr"))); - // an offset value for the placement of step tabs used in a Supplemental Information section of SAMG procedures - // to allow space for a Note or Caution tab. - private LazyLoad _SupInfoTabOff; - public int? SupInfoTabOff - { - get - { - return LazyLoad(ref _SupInfoTabOff, "@SupInfoTabOff"); - } - } + // an offset value for the placement of step tabs used in a Supplemental Information section of SAMG procedures + // to allow space for a Note or Caution tab. + private LazyLoad _SupInfoTabOff; + public int? SupInfoTabOff => LazyLoad(ref _SupInfoTabOff, "@SupInfoTabOff"); - // Flag to determin if the parent tab is used as the first part of a supplemental info step/sub-step tab. - private LazyLoad _SupInfoIncludeParTab; - public bool SupInfoIncludeParTab - { - get - { - return LazyLoad(ref _SupInfoIncludeParTab, "@SupInfoIncludeParTab"); - } - } + // Flag to determin if the parent tab is used as the first part of a supplemental info step/sub-step tab. + private LazyLoad _SupInfoIncludeParTab; + public bool SupInfoIncludeParTab => LazyLoad(ref _SupInfoIncludeParTab, "@SupInfoIncludeParTab"); - // Shift the hoizontal positon of a step by 12 if the supplemental Info step tab was going to print over step text - private LazyLoad _SupInfoAdjustXOffForLongTab; - public bool SupInfoAdjustXOffForLongTab - { - get - { - return LazyLoad(ref _SupInfoAdjustXOffForLongTab, "@SupInfoAdjustXOffForLongTab"); - } - } + // Shift the hoizontal positon of a step by 12 if the supplemental Info step tab was going to print over step text + private LazyLoad _SupInfoAdjustXOffForLongTab; + public bool SupInfoAdjustXOffForLongTab => LazyLoad(ref _SupInfoAdjustXOffForLongTab, "@SupInfoAdjustXOffForLongTab"); - // flag to allow user to enter the procedure revision number, either a forward or back slash, - // then the revision date or revision text - private LazyLoad _DoRevDate; - public bool DoRevDate - { - get - { - return LazyLoad(ref _DoRevDate, "@DoRevDate"); - } - } + // flag to allow user to enter the procedure revision number, either a forward or back slash, + // then the revision date or revision text + private LazyLoad _DoRevDate; + public bool DoRevDate => LazyLoad(ref _DoRevDate, "@DoRevDate"); - // Print alternate foldout pages within a defined range of procedure step pages. - // You can have multiple Foldout Page sections within a procedure, - // each pertaining to a range of steps (ranges cannot overlap) - used by Shearon Harris - private LazyLoad _AlternateFloatingFoldout; - public bool AlternateFloatingFoldout - { - get - { - return LazyLoad(ref _AlternateFloatingFoldout, "@AlternateFloatingFoldout"); - } - } + // Print alternate foldout pages within a defined range of procedure step pages. + // You can have multiple Foldout Page sections within a procedure, + // each pertaining to a range of steps (ranges cannot overlap) - used by Shearon Harris + private LazyLoad _AlternateFloatingFoldout; + public bool AlternateFloatingFoldout => LazyLoad(ref _AlternateFloatingFoldout, "@AlternateFloatingFoldout"); - // Allows the user to identify a procedure section that is to be used as a foldout page - // that is printed on the backside of procedure step pages - private LazyLoad _SectionLevelFoldouts; - public bool SectionLevelFoldouts - { - get - { - return LazyLoad(ref _SectionLevelFoldouts, "@SectionLevelFoldouts"); - } - } + // Allows the user to identify a procedure section that is to be used as a foldout page + // that is printed on the backside of procedure step pages + private LazyLoad _SectionLevelFoldouts; + public bool SectionLevelFoldouts => LazyLoad(ref _SectionLevelFoldouts, "@SectionLevelFoldouts"); - // This will replace any forward or back slash character they may be in the procedures's PDF file name - // with the character defined in the plant's format file - private LazyLoad _SlashReplace; - public string SlashReplace - { - get - { - return LazyLoad(ref _SlashReplace, "@SlashReplace"); - } - } + // This will replace any forward or back slash character they may be in the procedures's PDF file name + // with the character defined in the plant's format file + private LazyLoad _SlashReplace; + public string SlashReplace => LazyLoad(ref _SlashReplace, "@SlashReplace"); - // Flag - (flag is named incorrectly) when set allows user to append to the procedure's revision number, - // a backslash character followed by a revision date - private LazyLoad _RevDateWithForwardSlash; - public bool RevDateWithForwardSlash - { - get - { - return LazyLoad(ref _RevDateWithForwardSlash, "@RevDateWithForwardSlash"); - } - } + // Flag - (flag is named incorrectly) when set allows user to append to the procedure's revision number, + // a backslash character followed by a revision date + private LazyLoad _RevDateWithForwardSlash; + public bool RevDateWithForwardSlash => LazyLoad(ref _RevDateWithForwardSlash, "@RevDateWithForwardSlash"); - // On the Working Draft Properties page, Turns on a text box for the user to enter in a unit number - // that is used on cover pages and in the page header - D.C. Cook and Calvert Cliffs formats - private LazyLoad _UnitNumber; - public bool UnitNumber - { - get - { - return LazyLoad(ref _UnitNumber, "@UnitNumber"); - } - } + // On the Working Draft Properties page, Turns on a text box for the user to enter in a unit number + // that is used on cover pages and in the page header - D.C. Cook and Calvert Cliffs formats + private LazyLoad _UnitNumber; + public bool UnitNumber => LazyLoad(ref _UnitNumber, "@UnitNumber"); - // Flag allow for using the UnitProcSetString transition defintion variable which will build - // a prefix to the referenced procedure number - // ex: UnitProcSetString ="{PSI:UNITCOM}-{SI:SETNAME}-{PSI:SETID|4023}-" will look for UNITCOM in - // the Procedure Specific Information, then SETNAME in the Set Specific Information (working draft), - // then the SETID in the Procedure Specific Information (or use 4023) if nothing is entered - private LazyLoad _OutSideTransSetName; //B2019-072: For AEP, use PSI & SI for outside transition text - public bool OutSideTransSetName - { - get - { - return LazyLoad(ref _OutSideTransSetName, "@OutSideTransSetName"); - } - } + // Flag allow for using the UnitProcSetString transition defintion variable which will build + // a prefix to the referenced procedure number + // ex: UnitProcSetString ="{PSI:UNITCOM}-{SI:SETNAME}-{PSI:SETID|4023}-" will look for UNITCOM in + // the Procedure Specific Information, then SETNAME in the Set Specific Information (working draft), + // then the SETID in the Procedure Specific Information (or use 4023) if nothing is entered + private LazyLoad _OutSideTransSetName; //B2019-072: For AEP, use PSI & SI for outside transition text + public bool OutSideTransSetName => LazyLoad(ref _OutSideTransSetName, "@OutSideTransSetName"); - // For Calvert Cliffs, this allows for double letted step tabs, speical handling in Transitions, - // special pagination logic for their style of procedures - private LazyLoad _SpecialCaseCalvert; - public bool SpecialCaseCalvert - { - get - { - return LazyLoad(ref _SpecialCaseCalvert, "@SpecialCaseCalvert"); - } - } + // For Calvert Cliffs, this allows for double letted step tabs, speical handling in Transitions, + // special pagination logic for their style of procedures + private LazyLoad _SpecialCaseCalvert; + public bool SpecialCaseCalvert => LazyLoad(ref _SpecialCaseCalvert, "@SpecialCaseCalvert"); - // Calvert Alarms have the top part of the alarm point page in single column, the the bottom part in two column. - // Also special processing of Note, Cautions and Warnings - private LazyLoad _SpecialCaseCalvertAlarm; - public bool SpecialCaseCalvertAlarm - { - get - { - return LazyLoad(ref _SpecialCaseCalvertAlarm, "@SpecialCaseCalvertAlarm"); - } - } + // Calvert Alarms have the top part of the alarm point page in single column, the the bottom part in two column. + // Also special processing of Note, Cautions and Warnings + private LazyLoad _SpecialCaseCalvertAlarm; + public bool SpecialCaseCalvertAlarm => LazyLoad(ref _SpecialCaseCalvertAlarm, "@SpecialCaseCalvertAlarm"); - // Special pagination logic to handle out of the ordinary procedure formating and steps with RNOs - // that go on for pages - private LazyLoad _SpecialCaseCalvertPagination; - public bool SpecialCaseCalvertPagination - { - get - { - return LazyLoad(ref _SpecialCaseCalvertPagination, "@SpecialCaseCalvertPagination"); - } - } + // Special pagination logic to handle out of the ordinary procedure formating and steps with RNOs + // that go on for pages + private LazyLoad _SpecialCaseCalvertPagination; + public bool SpecialCaseCalvertPagination => LazyLoad(ref _SpecialCaseCalvertPagination, "@SpecialCaseCalvertPagination"); - // B2023-034 for use with Beaver Valley AOP format - // This allows for the use of the UseOnFirst docstyle setting on a mixture of sections and sub-sections - private LazyLoad _UseOnFirstForSeparatePaginationOnSubSect; - public bool UseOnFirstForSeparatePaginationOnSubSect - { - get - { - return LazyLoad(ref _UseOnFirstForSeparatePaginationOnSubSect, "@UseOnFirstForSeparatePaginationOnSubSect"); - } - } + // B2023-034 for use with Beaver Valley AOP format + // This allows for the use of the UseOnFirst docstyle setting on a mixture of sections and sub-sections + private LazyLoad _UseOnFirstForSeparatePaginationOnSubSect; + public bool UseOnFirstForSeparatePaginationOnSubSect => LazyLoad(ref _UseOnFirstForSeparatePaginationOnSubSect, "@UseOnFirstForSeparatePaginationOnSubSect"); - // B2023-043 for use with Beaver Valley AOP format - allow attributes, such as superscript on section titles - // when printing - private LazyLoad _SectionTitleWithAttributes; - public bool SectionTitleWithAttributes - { - get - { - return LazyLoad(ref _SectionTitleWithAttributes, "@SectionTitleWithAttributes"); - } - } + // B2023-043 for use with Beaver Valley AOP format - allow attributes, such as superscript on section titles + // when printing + private LazyLoad _SectionTitleWithAttributes; + public bool SectionTitleWithAttributes => LazyLoad(ref _SectionTitleWithAttributes, "@SectionTitleWithAttributes"); - // Format Flag enabling special formatting and printing of training materials - Wolf Creek Training format - private LazyLoad _WCNTraining; - public bool WCNTraining - { - get - { - return LazyLoad(ref _WCNTraining, "@WCNTraining"); - } - } + // Format Flag enabling special formatting and printing of training materials - Wolf Creek Training format + private LazyLoad _WCNTraining; + public bool WCNTraining => LazyLoad(ref _WCNTraining, "@WCNTraining"); - // Only used in Calvert Cliffs Valve format - only supporting code checks to see - // if a note should be a footnote - private LazyLoad _HorizontalSubsteps; - public bool HorizontalSubsteps - { - get - { - return LazyLoad(ref _HorizontalSubsteps, "@HorizontalSubsteps"); - } - } + // Only used in Calvert Cliffs Valve format - only supporting code checks to see + // if a note should be a footnote + private LazyLoad _HorizontalSubsteps; + public bool HorizontalSubsteps => LazyLoad(ref _HorizontalSubsteps, "@HorizontalSubsteps"); - // Doesn't reset the paglist for the first sub-section when printing - // - appears to be needed for plants with AP1000 procedures - private LazyLoad _SpecialCaseWestinghouse; - public bool SpecialCaseWestinghouse - { - get - { - return LazyLoad(ref _SpecialCaseWestinghouse, "@SpecialCaseWestinghouse"); - } - } + // Doesn't reset the paglist for the first sub-section when printing + // - appears to be needed for plants with AP1000 procedures + private LazyLoad _SpecialCaseWestinghouse; + public bool SpecialCaseWestinghouse => LazyLoad(ref _SpecialCaseWestinghouse, "@SpecialCaseWestinghouse"); - // Put in for Comanche Peak to print "COMMON" for the unit number instead of "Unit 0" - private LazyLoad _PrintCommonForZeroUnit; - public bool PrintCommonForZeroUnit - { - get - { - return LazyLoad(ref _PrintCommonForZeroUnit, "@PrintCommonForZeroUnit"); - } - } + // Put in for Comanche Peak to print "COMMON" for the unit number instead of "Unit 0" + private LazyLoad _PrintCommonForZeroUnit; + public bool PrintCommonForZeroUnit => LazyLoad(ref _PrintCommonForZeroUnit, "@PrintCommonForZeroUnit"); - // F2021-033: Barakah Alarm: no blank line between HLS & first substep - private LazyLoad _NoBlankHlsAndFirstSub; - public bool NoBlankHlsAndFirstSub - { - get - { - return LazyLoad(ref _NoBlankHlsAndFirstSub, "@NoBlankHlsAndFirstSub"); - } - } + // F2021-033: Barakah Alarm: no blank line between HLS & first substep + private LazyLoad _NoBlankHlsAndFirstSub; + public bool NoBlankHlsAndFirstSub => LazyLoad(ref _NoBlankHlsAndFirstSub, "@NoBlankHlsAndFirstSub"); - // F2021-025: Barakah Alarm: no blank line between last Note/Caution/Warn & box line - private LazyLoad _NoBlankLastNoteCautionWarn; - public bool NoBlankLastNoteCautionWarn - { - get - { - return LazyLoad(ref _NoBlankLastNoteCautionWarn, "@NoBlankLastNoteCautionWarn"); - } - } + // F2021-025: Barakah Alarm: no blank line between last Note/Caution/Warn & box line + private LazyLoad _NoBlankLastNoteCautionWarn; + public bool NoBlankLastNoteCautionWarn => LazyLoad(ref _NoBlankLastNoteCautionWarn, "@NoBlankLastNoteCautionWarn"); - // F2023-126: Vogtle Alarms - center single line caution/note if more than one type exist off step - private LazyLoad _NoteCautionCenterOneAllTypes; - public bool NoteCautionCenterOneAllTypes - { - get - { - return LazyLoad(ref _NoteCautionCenterOneAllTypes, "@NoteCautionCenterOneAllTypes"); - } - } + // F2023-126: Vogtle Alarms - center single line caution/note if more than one type exist off step + private LazyLoad _NoteCautionCenterOneAllTypes; + public bool NoteCautionCenterOneAllTypes => LazyLoad(ref _NoteCautionCenterOneAllTypes, "@NoteCautionCenterOneAllTypes"); - // C2021-063 Barakah Alarm: check box to generate Alarm Point List Text - private LazyLoad _ChkBoxToGeneratePointListText; - public bool ChkBoxToGeneratePointListText - { - get - { - return LazyLoad(ref _ChkBoxToGeneratePointListText, "@ChkBoxToGeneratePointListText"); - } - } + // C2021-063 Barakah Alarm: check box to generate Alarm Point List Text + private LazyLoad _ChkBoxToGeneratePointListText; + public bool ChkBoxToGeneratePointListText => LazyLoad(ref _ChkBoxToGeneratePointListText, "@ChkBoxToGeneratePointListText"); - // C2022-004 When a procedure is approved, force the watermark of the unit number - // (defined in the format file under UnitWatermarkData) - private LazyLoad _UseUnitWatermarkOnApproved; - public bool UseUnitWatermarkOnApproved - { - get - { - return LazyLoad(ref _UseUnitWatermarkOnApproved, "@UseUnitWatermarkOnApproved"); - } - } + // C2022-004 When a procedure is approved, force the watermark of the unit number + // (defined in the format file under UnitWatermarkData) + private LazyLoad _UseUnitWatermarkOnApproved; + public bool UseUnitWatermarkOnApproved => LazyLoad(ref _UseUnitWatermarkOnApproved, "@UseUnitWatermarkOnApproved"); - // B2022-086: Barakah - flag to adjust ypagesize for pagination when 1st and later pages have different printable box size - private LazyLoad _AdjFirstSecDocStylesInPagination; - public bool AdjFirstSecDocStylesInPagination - { - get - { - return LazyLoad(ref _AdjFirstSecDocStylesInPagination, "@AdjFirstSecDocStylesInPagination"); - } - } + // B2022-086: Barakah - flag to adjust ypagesize for pagination when 1st and later pages have different printable box size + private LazyLoad _AdjFirstSecDocStylesInPagination; + public bool AdjFirstSecDocStylesInPagination => LazyLoad(ref _AdjFirstSecDocStylesInPagination, "@AdjFirstSecDocStylesInPagination"); - // Adjust the image size to better fit on the printed page - private LazyLoad _AdjustLargeImage; - public bool AdjustLargeImage - { - get - { - return LazyLoad(ref _AdjustLargeImage, "@AdjustLargeImage"); - } - } - } + // Adjust the image size to better fit on the printed page + private LazyLoad _AdjustLargeImage; + public bool AdjustLargeImage => LazyLoad(ref _AdjustLargeImage, "@AdjustLargeImage"); + } #endregion PrintData #region ProcDescr [TypeConverter(typeof(ExpandableObjectConverter))] @@ -1429,38 +1014,17 @@ namespace VEPROMS.CSLA.Library // procedure number part (pattern) to match to find a description to use with the {PROCDESC} pagelist token private LazyLoad _MatchProcNumber; - public string MatchProcNumber - { - get - { - return LazyLoad(ref _MatchProcNumber, "@MatchProcNumber"); - } - } + public string MatchProcNumber => LazyLoad(ref _MatchProcNumber, "@MatchProcNumber"); - // The description text associated with a MatchProcNumber Text is used to replace the {PROCDES1} pagelist - private LazyLoad _ProcDescr1; - public string ProcDescr1 - { - get - { - return LazyLoad(ref _ProcDescr1, "@ProcDescr1"); - } - } + // The description text associated with a MatchProcNumber Text is used to replace the {PROCDES1} pagelist + private LazyLoad _ProcDescr1; + public string ProcDescr1 => LazyLoad(ref _ProcDescr1, "@ProcDescr1"); - // A second description text associated with a MatchProcNumber. Text is used to replace the {PROCDES2} - private LazyLoad _ProcDescr2; - public string ProcDescr2 - { - get - { - return LazyLoad(ref _ProcDescr2, "@ProcDescr2"); - } - } - public override string ToString() - { - return string.Format("{0}, {1}", ProcDescr1, MatchProcNumber); - } - } + // A second description text associated with a MatchProcNumber. Text is used to replace the {PROCDES2} + private LazyLoad _ProcDescr2; + public string ProcDescr2 => LazyLoad(ref _ProcDescr2, "@ProcDescr2"); + public override string ToString() => string.Format("{0}, {1}", ProcDescr1, MatchProcNumber); + } #region ProcDescrList [TypeConverter(typeof(vlnListConverter))] public class ProcDescrList : vlnFormatList @@ -1477,98 +1041,44 @@ namespace VEPROMS.CSLA.Library { public ProcData(XmlNode xmlNode) : base(xmlNode) { } private ChangeBarData _ChangeBarData; - public ChangeBarData ChangeBarData - { - get - { - return _ChangeBarData == null ? _ChangeBarData = new ChangeBarData(SelectSingleNode("ChangeBarData")) : _ChangeBarData; - } - } - private CheckOffData _CheckOffData; - public CheckOffData CheckOffData - { - get - { - return _CheckOffData == null ? _CheckOffData = new CheckOffData(SelectSingleNode("CheckOffData")) : _CheckOffData; - } - } - private PSI _PSI; - public PSI PSI - { - get - { - return _PSI == null ? _PSI = new PSI(SelectSingleNode("PSI")) : _PSI; - } - } + public ChangeBarData ChangeBarData => _ChangeBarData ?? (_ChangeBarData = new ChangeBarData(SelectSingleNode("ChangeBarData"))); + private CheckOffData _CheckOffData; + public CheckOffData CheckOffData => _CheckOffData ?? (_CheckOffData = new CheckOffData(SelectSingleNode("CheckOffData"))); + private PSI _PSI; + public PSI PSI => _PSI ?? (_PSI = new PSI(SelectSingleNode("PSI"))); - // specifies the maxiumn length of the procedure title before PROMS considers to wrap the title - // this is used with the {PROCTITLE} PageStyle toekn - private LazyLoad _TitleLength; - public int? TitleLength - { - get - { - return LazyLoad(ref _TitleLength, "@TitleLength"); - } - } + // specifies the maxiumn length of the procedure title before PROMS considers to wrap the title + // this is used with the {PROCTITLE} PageStyle toekn + private LazyLoad _TitleLength; + public int? TitleLength => LazyLoad(ref _TitleLength, "@TitleLength"); - // Length of the procedure title before wrapping on the Cover Page. T - // his is used with the {COVERPROCTITLE} PageSytle token - private LazyLoad _CoverTitleLength; - public int? CoverTitleLength - { - get - { - return LazyLoad(ref _CoverTitleLength, "@CoverTitleLength"); - } - } + // Length of the procedure title before wrapping on the Cover Page. T + // his is used with the {COVERPROCTITLE} PageSytle token + private LazyLoad _CoverTitleLength; + public int? CoverTitleLength => LazyLoad(ref _CoverTitleLength, "@CoverTitleLength"); - // Uppercase the procedure title when printed - private LazyLoad _CapitalizeTitle; - public bool CapitalizeTitle - { - get - { - return LazyLoad(ref _CapitalizeTitle, "@CapitalizeTitle"); - } - } + // Uppercase the procedure title when printed + private LazyLoad _CapitalizeTitle; + public bool CapitalizeTitle => LazyLoad(ref _CapitalizeTitle, "@CapitalizeTitle"); - // If a procedure or section does not have a title PROMS puts in "" as default title text - // by default (base format) PROMS will print "" - // When set to False, this flag prevents PROMS printing the text "" - // This also affects transiton references - private LazyLoad _PrintNoTitle; - public bool PrintNoTitle - { - get - { - return LazyLoad(ref _PrintNoTitle, "@PrintNoTitle"); - } - } + // If a procedure or section does not have a title PROMS puts in "" as default title text + // by default (base format) PROMS will print "" + // When set to False, this flag prevents PROMS printing the text "" + // This also affects transiton references + private LazyLoad _PrintNoTitle; + public bool PrintNoTitle => LazyLoad(ref _PrintNoTitle, "@PrintNoTitle"); - // This will print Notes at the bottom of the page as footnotes - // Use by Calvert Cliffs (BGE) primarily for their landscaped valve sections - private LazyLoad _NotesToFootnotes; - public bool NotesToFootnotes - { - get - { - return LazyLoad(ref _NotesToFootnotes, "@NotesToFootnotes"); - } - } + // This will print Notes at the bottom of the page as footnotes + // Use by Calvert Cliffs (BGE) primarily for their landscaped valve sections + private LazyLoad _NotesToFootnotes; + public bool NotesToFootnotes => LazyLoad(ref _NotesToFootnotes, "@NotesToFootnotes"); - // C2021-027: Procedure level PC/PC - // This allows us to assign an entire procedure's applicability level - // instead of just the sections and steps - private LazyLoad _ProcAppl; - public bool ProcAppl - { - get - { - return LazyLoad(ref _ProcAppl, "@ProcAppl"); - } - } - } + // C2021-027: Procedure level PC/PC + // This allows us to assign an entire procedure's applicability level + // instead of just the sections and steps + private LazyLoad _ProcAppl; + public bool ProcAppl => LazyLoad(ref _ProcAppl, "@ProcAppl"); + } #endregion #region PsiAll @@ -1582,58 +1092,22 @@ namespace VEPROMS.CSLA.Library // and cover pages (i.e. signaure names, dates, Use Categories) public PSI(XmlNode xmlNode) : base(xmlNode) { } private LazyLoad _x; - public int? x - { - get - { - return LazyLoad(ref _x, "@x"); - } - } - private LazyLoad _y; - public int? y - { - get - { - return LazyLoad(ref _y, "@y"); - } - } - private LazyLoad _Caption; - // caption for the PSI window - public string Caption - { - get - { - return LazyLoad(ref _Caption, "@Caption"); - } - } - private LazyLoad _ButtonsOnBottom; // change to bool - // place the OK and Cancel buttons on the bottom of the PSI window - public string ButtonsOnBottom - { - get - { - return LazyLoad(ref _ButtonsOnBottom, "@ButtonsOnBottom"); - } - } - // returns a list of labels that are defined in the format's PSI structure - private SILabels _LabelList; - public SILabels LabelList - { - get - { - return _LabelList == null ? _LabelList = new SILabels(SelectNodes("/PlantFormat/FormatData/ProcData/PSI/Label")) : _LabelList; - } - } - // returns a list of fields that are defined in the format's PSI structure - private SIFields _FieldList; - public SIFields FieldList - { - get - { - return _FieldList == null ? _FieldList = new SIFields(SelectNodes("/PlantFormat/FormatData/ProcData/PSI/Field")) : _FieldList; - } - } - } + public int? x => LazyLoad(ref _x, "@x"); + private LazyLoad _y; + public int? y => LazyLoad(ref _y, "@y"); + private LazyLoad _Caption; + // caption for the PSI window + public string Caption => LazyLoad(ref _Caption, "@Caption"); + private LazyLoad _ButtonsOnBottom; // change to bool + // place the OK and Cancel buttons on the bottom of the PSI window + public string ButtonsOnBottom => LazyLoad(ref _ButtonsOnBottom, "@ButtonsOnBottom"); + // returns a list of labels that are defined in the format's PSI structure + private SILabels _LabelList; + public SILabels LabelList => _LabelList ?? (_LabelList = new SILabels(SelectNodes("/PlantFormat/FormatData/ProcData/PSI/Label"))); + // returns a list of fields that are defined in the format's PSI structure + private SIFields _FieldList; + public SIFields FieldList => _FieldList ?? (_FieldList = new SIFields(SelectNodes("/PlantFormat/FormatData/ProcData/PSI/Field"))); + } public class SILabels : vlnFormatList { public SILabels(XmlNodeList xmlNodeList) : base(xmlNodeList) { } @@ -1645,54 +1119,18 @@ namespace VEPROMS.CSLA.Library public SILabel(XmlNode xmlNode) : base(xmlNode) { } public SILabel() : base() { } private LazyLoad _text; - public string text - { - get - { - return LazyLoad(ref _text, "@text"); - } - } - private LazyLoad _Justify; - public string Justify - { - get - { - return LazyLoad(ref _Justify, "@Justify"); - } - } - private LazyLoad _x; - public int? x - { - get - { - return LazyLoad(ref _x, "@x"); - } - } - private LazyLoad _y; - public int? y - { - get - { - return LazyLoad(ref _y, "@y"); - } - } - private LazyLoad _width; - public int? width - { - get - { - return LazyLoad(ref _width, "@width"); - } - } - private LazyLoad _height; - public int? height - { - get - { - return LazyLoad(ref _height, "@height"); - } - } - } + public string text => LazyLoad(ref _text, "@text"); + private LazyLoad _Justify; + public string Justify => LazyLoad(ref _Justify, "@Justify"); + private LazyLoad _x; + public int? x => LazyLoad(ref _x, "@x"); + private LazyLoad _y; + public int? y => LazyLoad(ref _y, "@y"); + private LazyLoad _width; + public int? width => LazyLoad(ref _width, "@width"); + private LazyLoad _height; + public int? height => LazyLoad(ref _height, "@height"); + } public class SIFields : vlnFormatList { public SIFields(XmlNodeList xmlNodeList) : base(xmlNodeList) { } @@ -1703,78 +1141,24 @@ namespace VEPROMS.CSLA.Library public SIField(XmlNode xmlNode) : base(xmlNode) { } public SIField() : base() { } private LazyLoad _name; - public string name - { - get - { - return LazyLoad(ref _name, "@name"); - } - } - private LazyLoad _type; - public string type - { - get - { - return LazyLoad(ref _type, "@type"); - } - } - private LazyLoad _text; - public string text - { - get - { - return LazyLoad(ref _text, "@text"); - } - } - private LazyLoad _Length; - public int? Length - { - get - { - return LazyLoad(ref _Length, "@Length"); - } - } - private LazyLoad _x; - public int? x - { - get - { - return LazyLoad(ref _x, "@x"); - } - } - private LazyLoad _y; - public int? y - { - get - { - return LazyLoad(ref _y, "@y"); - } - } - private LazyLoad _width; - public int? width - { - get - { - return LazyLoad(ref _width, "@width"); - } - } - private LazyLoad _height; - public int? height - { - get - { - return LazyLoad(ref _height, "@height"); - } - } - private LazyLoad _hasAppl; - public string hasAppl - { - get - { - return LazyLoad(ref _hasAppl, "@hasAppl"); - } - } - } + public string name => LazyLoad(ref _name, "@name"); + private LazyLoad _type; + public string type => LazyLoad(ref _type, "@type"); + private LazyLoad _text; + public string text => LazyLoad(ref _text, "@text"); + private LazyLoad _Length; + public int? Length => LazyLoad(ref _Length, "@Length"); + private LazyLoad _x; + public int? x => LazyLoad(ref _x, "@x"); + private LazyLoad _y; + public int? y => LazyLoad(ref _y, "@y"); + private LazyLoad _width; + public int? width => LazyLoad(ref _width, "@width"); + private LazyLoad _height; + public int? height => LazyLoad(ref _height, "@height"); + private LazyLoad _hasAppl; + public string hasAppl => LazyLoad(ref _hasAppl, "@hasAppl"); + } #endregion #region SIAll // classes to handle Set Specific information @@ -1784,56 +1168,20 @@ namespace VEPROMS.CSLA.Library { public SI(XmlNode xmlNode) : base(xmlNode) { } private LazyLoad _x; - public int? x - { - get - { - return LazyLoad(ref _x, "@x"); - } - } - private LazyLoad _y; - public int? y - { - get - { - return LazyLoad(ref _y, "@y"); - } - } - // caption for the the Set Specific information window - private LazyLoad _Caption; - public string Caption - { - get - { - return LazyLoad(ref _Caption, "@Caption"); - } - } - // the the OK and Cancel buttons on the bottom of the SI Window - private LazyLoad _ButtonsOnBottom; // change to bool - public string ButtonsOnBottom - { - get - { - return LazyLoad(ref _ButtonsOnBottom, "@ButtonsOnBottom"); - } - } - private SILabels _LabelList; - public SILabels LabelList - { - get - { - return _LabelList == null ? _LabelList = new SILabels(SelectNodes("/PlantFormat/FormatData/SI/Label")) : _LabelList; - } - } - private SIFields _FieldList; - public SIFields FieldList - { - get - { - return _FieldList == null ? _FieldList = new SIFields(SelectNodes("/PlantFormat/FormatData/SI/Field")) : _FieldList; - } - } - } + public int? x => LazyLoad(ref _x, "@x"); + private LazyLoad _y; + public int? y => LazyLoad(ref _y, "@y"); + // caption for the the Set Specific information window + private LazyLoad _Caption; + public string Caption => LazyLoad(ref _Caption, "@Caption"); + // the the OK and Cancel buttons on the bottom of the SI Window + private LazyLoad _ButtonsOnBottom; // change to bool + public string ButtonsOnBottom => LazyLoad(ref _ButtonsOnBottom, "@ButtonsOnBottom"); + private SILabels _LabelList; + public SILabels LabelList => _LabelList ?? (_LabelList = new SILabels(SelectNodes("/PlantFormat/FormatData/SI/Label"))); + private SIFields _FieldList; + public SIFields FieldList => _FieldList ?? (_FieldList = new SIFields(SelectNodes("/PlantFormat/FormatData/SI/Field"))); + } #endregion #region CheckOffAll #region CheckOffData @@ -1865,10 +1213,10 @@ namespace VEPROMS.CSLA.Library get { if (_CheckOffHeaderList != null) return _CheckOffHeaderList; - FormatConfig fc = PlantFormat.GetFormatConfig(MyFormat); + _ = PlantFormat.GetFormatConfig(MyFormat); - // merge the checkoff header lists from the current format and the list from the base - _CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat); + // merge the checkoff header lists from the current format and the list from the base + _CheckOffHeaderList = new CheckOffHeaderList(SelectNodes("CheckOffHeaderList/CheckOffHeader"), MyFormat); return _CheckOffHeaderList; } @@ -1877,108 +1225,48 @@ namespace VEPROMS.CSLA.Library // This is used with the {INITIALS} pagelist token and will put the word "INITIALS" at the specified pagelist // location for the checkoff column header. Used by Calvert Cliffs (BGEOI and BGESTP formats) private LazyLoad _CheckOffHeaderInPagelist; - public bool CheckOffHeaderInPagelist - { - get - { - return LazyLoad(ref _CheckOffHeaderInPagelist, "@CheckOffHeaderInPagelist"); - } - } - // Menu heading for checkoffs/signoffs. When this is set to "Signoff", the checkoff list is not enabled - private LazyLoad _Menu; - public string Menu - { - get - { - return LazyLoad(ref _Menu, "@Menu"); - } - } + public bool CheckOffHeaderInPagelist => LazyLoad(ref _CheckOffHeaderInPagelist, "@CheckOffHeaderInPagelist"); + // Menu heading for checkoffs/signoffs. When this is set to "Signoff", the checkoff list is not enabled + private LazyLoad _Menu; + public string Menu => LazyLoad(ref _Menu, "@Menu"); - // this will make room on the page for checkoffs by adjusting the step text width. Used for cases where there isn't - // a checkoff header (we adjust step text width when a checkoff header is printed) - private LazyLoad _CheckOffAdjustment; - public float? CheckOffAdjustment - { - get - { - return LazyLoad(ref _CheckOffAdjustment, "@CheckOffAdjustment"); - } - } - // used for checkoff (initial line) next to the step number tab. the XLocation number is added to the left margin - private LazyLoad _XLocation; - public float? XLocation - { - get - { - return LazyLoad(ref _XLocation, "@XLocation"); - } - } + // this will make room on the page for checkoffs by adjusting the step text width. Used for cases where there isn't + // a checkoff header (we adjust step text width when a checkoff header is printed) + private LazyLoad _CheckOffAdjustment; + public float? CheckOffAdjustment => LazyLoad(ref _CheckOffAdjustment, "@CheckOffAdjustment"); + // used for checkoff (initial line) next to the step number tab. the XLocation number is added to the left margin + private LazyLoad _XLocation; + public float? XLocation => LazyLoad(ref _XLocation, "@XLocation"); - // relative location of the checkoff based on the text width and its location on the page - private LazyLoad _RelXLocation; - public float? RelXLocation - { - get - { - return LazyLoad(ref _RelXLocation, "@RelXLocation"); - } - } + // relative location of the checkoff based on the text width and its location on the page + private LazyLoad _RelXLocation; + public float? RelXLocation => LazyLoad(ref _RelXLocation, "@RelXLocation"); - //Start printing the checkoff on the last line of the step text (when set here applies to all checkofs) - private LazyLoad _DropCheckOff; - public bool DropCheckOff - { - get - { - return LazyLoad(ref _DropCheckOff, "@DropCheckOff"); - } - } + //Start printing the checkoff on the last line of the step text (when set here applies to all checkofs) + private LazyLoad _DropCheckOff; + public bool DropCheckOff => LazyLoad(ref _DropCheckOff, "@DropCheckOff"); - // put checkoff only on High Level Steps - private LazyLoad _CheckOffOnHLSOnly; - public bool CheckOffOnHLSOnly - { - get - { - return LazyLoad(ref _CheckOffOnHLSOnly, "@CheckOffOnHLSOnly"); - } - } + // put checkoff only on High Level Steps + private LazyLoad _CheckOffOnHLSOnly; + public bool CheckOffOnHLSOnly => LazyLoad(ref _CheckOffOnHLSOnly, "@CheckOffOnHLSOnly"); - // SkipSpaces puts the checkoff macro (if specified in the format) next to the step tab - // the print logic looks at the step tab and skips (backwards) the lenth (width) of the tab - // to position the checkoff - // - this is used for Bryon and Braidwood - private LazyLoad _SkipSpaces; - public bool SkipSpaces - { - get - { - return LazyLoad(ref _SkipSpaces, "@SkipSpaces"); - } - } + // SkipSpaces puts the checkoff macro (if specified in the format) next to the step tab + // the print logic looks at the step tab and skips (backwards) the lenth (width) of the tab + // to position the checkoff + // - this is used for Bryon and Braidwood + private LazyLoad _SkipSpaces; + public bool SkipSpaces => LazyLoad(ref _SkipSpaces, "@SkipSpaces"); - // put in for Bryon and Braidwood - // enables the selection of a checkoff only when on a sub-step type - private LazyLoad _CheckoffOnSubStepsOnly; - public bool CheckoffOnSubStepsOnly - { - get - { - return LazyLoad(ref _CheckoffOnSubStepsOnly, "@CheckoffOnSubStepsOnly"); - } - } + // put in for Bryon and Braidwood + // enables the selection of a checkoff only when on a sub-step type + private LazyLoad _CheckoffOnSubStepsOnly; + public bool CheckoffOnSubStepsOnly => LazyLoad(ref _CheckoffOnSubStepsOnly, "@CheckoffOnSubStepsOnly"); - // C2019-040 This will adjust the right margin (making room for the checkoff) without the need of selecting a checkoff header - // the flag allows us to use existing coding that prior to this was restricted by format file name - private LazyLoad _CheckoffsWithoutHeader; - public bool CheckoffsWithoutHeader - { - get - { - return LazyLoad(ref _CheckoffsWithoutHeader, "@CheckoffsWithoutHeader"); - } - } - } + // C2019-040 This will adjust the right margin (making room for the checkoff) without the need of selecting a checkoff header + // the flag allows us to use existing coding that prior to this was restricted by format file name + private LazyLoad _CheckoffsWithoutHeader; + public bool CheckoffsWithoutHeader => LazyLoad(ref _CheckoffsWithoutHeader, "@CheckoffsWithoutHeader"); + } #endregion #region CheckOff @@ -1988,108 +1276,48 @@ namespace VEPROMS.CSLA.Library public CheckOff(XmlNode xmlNode) : base(xmlNode) { } public CheckOff() : base() { } private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - // C2020-003 used to sort list of checkoffs in the combo box - // a foat number can be used (ex 2.75) to fine tune the sorting - private LazyLoad _OrderBy; - public float? OrderBy - { - get - { - return LazyLoad(ref _OrderBy, "@OrderBy"); - } - } - // User Interface Mark (UIMark) is the deimal number of an ASCII character that is desplayed in the step editor - // to indicate the selected checkoff - private LazyLoad _UIMark; - public int? UIMark - { - get - { - return LazyLoad(ref _UIMark, "@UIMark"); - } - } + public int? Index => LazyLoad(ref _Index, "@Index"); + // C2020-003 used to sort list of checkoffs in the combo box + // a foat number can be used (ex 2.75) to fine tune the sorting + private LazyLoad _OrderBy; + public float? OrderBy => LazyLoad(ref _OrderBy, "@OrderBy"); + // User Interface Mark (UIMark) is the deimal number of an ASCII character that is desplayed in the step editor + // to indicate the selected checkoff + private LazyLoad _UIMark; + public int? UIMark => LazyLoad(ref _UIMark, "@UIMark"); - // If a positive numer, start the checkoff that number of lines minus one down from the start of the text - // and add that many lines after. - // If it's negative number, start the checkoff on the same line as the text - // and add positive of that number of lines after the checkoff macro. (see vlnPaaragraph.cs) - private LazyLoad _CheckOffXtraLines; - public float? CheckOffXtraLines - { - get - { - return LazyLoad(ref _CheckOffXtraLines, "@CheckOffXtraLines"); - } - } + // If a positive numer, start the checkoff that number of lines minus one down from the start of the text + // and add that many lines after. + // If it's negative number, start the checkoff on the same line as the text + // and add positive of that number of lines after the checkoff macro. (see vlnPaaragraph.cs) + private LazyLoad _CheckOffXtraLines; + public float? CheckOffXtraLines => LazyLoad(ref _CheckOffXtraLines, "@CheckOffXtraLines"); - // Add blank lines to make room for loner signoffs (checkoffs) - private LazyLoad _CheckOffNumberOfLines; - public float? CheckOffNumberOfLines - { - get - { - return LazyLoad(ref _CheckOffNumberOfLines, "@CheckOffNumberOfLines"); - } - } + // Add blank lines to make room for loner signoffs (checkoffs) + private LazyLoad _CheckOffNumberOfLines; + public float? CheckOffNumberOfLines => LazyLoad(ref _CheckOffNumberOfLines, "@CheckOffNumberOfLines"); - //Descriptive text shown in the checkoff selection list - private LazyLoad _MenuItem; - public string MenuItem - { - get - { - return LazyLoad(ref _MenuItem, "@MenuItem"); - } - } + //Descriptive text shown in the checkoff selection list + private LazyLoad _MenuItem; + public string MenuItem => LazyLoad(ref _MenuItem, "@MenuItem"); - // Name of the macro defined in the correspoinding SVG (GenMac) file. - // The print logic uese this macro to draw the checkoff - private LazyLoad _Macro; - public string Macro - { - get - { - return LazyLoad(ref _Macro, "@Macro"); - } - } + // Name of the macro defined in the correspoinding SVG (GenMac) file. + // The print logic uese this macro to draw the checkoff + private LazyLoad _Macro; + public string Macro => LazyLoad(ref _Macro, "@Macro"); - //Don’t' print the checkoff if the step text is empty (all spaces or hardspaces) - private LazyLoad _NotOnEmpty; - public bool NotOnEmpty - { - get - { - return LazyLoad(ref _NotOnEmpty, "@NotOnEmpty"); - } - } + //Don’t' print the checkoff if the step text is empty (all spaces or hardspaces) + private LazyLoad _NotOnEmpty; + public bool NotOnEmpty => LazyLoad(ref _NotOnEmpty, "@NotOnEmpty"); - // Start printing the checkoff on the last line of the step text (applies to just this checkoff) - private LazyLoad _DropCheckOff; - public bool DropCheckOff - { - get - { - return LazyLoad(ref _DropCheckOff, "@DropCheckOff"); - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}]",Index); } - public override string GetPDDescription() - { return string.Format("[{0}] - {1}", Index, MenuItem); } - public override string GetPDCategory() - { return "Checkoff Data"; } - public override string ToString() - { - return MenuItem; - } - } + // Start printing the checkoff on the last line of the step text (applies to just this checkoff) + private LazyLoad _DropCheckOff; + public bool DropCheckOff => LazyLoad(ref _DropCheckOff, "@DropCheckOff"); + public override string GetPDDisplayName() => string.Format("[{0}]", Index); + public override string GetPDDescription() => string.Format("[{0}] - {1}", Index, MenuItem); + public override string GetPDCategory() => "Checkoff Data"; + public override string ToString() => MenuItem; + } #endregion #region ShwRplWds // C2029-025 Show or hide replace words. Can highlight replace words in editor. @@ -2098,41 +1326,20 @@ namespace VEPROMS.CSLA.Library public ShwRplWds(XmlNode xmlNode) : base(xmlNode) { } public ShwRplWds() : base() { } private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } + public int? Index => LazyLoad(ref _Index, "@Index"); - // User Interface Mark (UIMark) is the deimal number of an ASCII character that is desplayed in the step editor - // to indicate the selected checkoff - private LazyLoad _UIMark; - public int? UIMark - { - get - { - return LazyLoad(ref _UIMark, "@UIMark"); - } - } + // User Interface Mark (UIMark) is the deimal number of an ASCII character that is desplayed in the step editor + // to indicate the selected checkoff + private LazyLoad _UIMark; + public int? UIMark => LazyLoad(ref _UIMark, "@UIMark"); - //Descriptive text shown in the checkoff selection list - private LazyLoad _MenuItem; - public string MenuItem - { - get - { - return LazyLoad(ref _MenuItem, "@MenuItem"); - } - } + //Descriptive text shown in the checkoff selection list + private LazyLoad _MenuItem; + public string MenuItem => LazyLoad(ref _MenuItem, "@MenuItem"); - public override string ToString() - { - return MenuItem; - } - } + public override string ToString() => MenuItem; + } #endregion #region CheckOffList [TypeConverter(typeof(vlnIndexedListConverter))] @@ -2159,42 +1366,18 @@ namespace VEPROMS.CSLA.Library public CheckOffHeader(XmlNode xmlNode) : base(xmlNode) { } public CheckOffHeader() : base() { } private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } + public int? Index => LazyLoad(ref _Index, "@Index"); + private VE_Font _Font; + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); - // the checkoff column heading text (when printed) - private LazyLoad _CheckOffHeading; - public string CheckOffHeading - { - get - { - return LazyLoad(ref _CheckOffHeading, "@CheckOffHeading"); - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}]", Index); } - public override string GetPDDescription() - { return string.Format("[{0}] - {1}", Index, CheckOffHeading); } - public override string GetPDCategory() - { return "Checkoff Header Data"; } - public override string ToString() - { - return CheckOffHeading; - } - } + // the checkoff column heading text (when printed) + private LazyLoad _CheckOffHeading; + public string CheckOffHeading => LazyLoad(ref _CheckOffHeading, "@CheckOffHeading"); + public override string GetPDDisplayName() => string.Format("[{0}]", Index); + public override string GetPDDescription() => string.Format("[{0}] - {1}", Index, CheckOffHeading); + public override string GetPDCategory() => "Checkoff Header Data"; + public override string ToString() => CheckOffHeading; + } #endregion #region CheckOffHeaderList [TypeConverter(typeof(vlnIndexedListConverter))] @@ -2225,105 +1408,51 @@ namespace VEPROMS.CSLA.Library // AER on LEFT, RNO on Right // To the Left of Text private LazyLoad _DefaultCBLoc; - public string DefaultCBLoc - { - get - { - return LazyLoad(ref _DefaultCBLoc, "@DefaultCBLoc"); - } - } - // text that is place next to the change bar - // DateChgID (Date and Change ID) - // RevNum (Revision Number) - // ChgID (Change ID) - // None (No Change Bar Message) - // UserDef (User Defined Message) - private LazyLoad _ChangeBarMessage; - public string ChangeBarMessage - { - get - { - return LazyLoad(ref _ChangeBarMessage, "@ChangeBarMessage"); - } - } - // FixedChangeColumn + - Column location for change bars - // 0 - Separate AER and RNO change bars to the right of the text - // -10 to -1 - Change bars on left (specify # of columns from the text) - // <-10 - AER change bars on the left and RNO change bars on the right. - private LazyLoad _FixedChangeColumn; - public int? FixedChangeColumn - { - get - { - return LazyLoad(ref _FixedChangeColumn, "@FixedChangeColumn"); - } - } - // specific location of change bars for text in AER column - // - appears to be used when FixedChageColumn is set to a number <-10 - private LazyLoad _FixedAERChangeColumn; - public int? FixedAERChangeColumn - { - get - { - return LazyLoad(ref _FixedAERChangeColumn, "@FixedAERChangeColumn"); - } - } + public string DefaultCBLoc => LazyLoad(ref _DefaultCBLoc, "@DefaultCBLoc"); + // text that is place next to the change bar + // DateChgID (Date and Change ID) + // RevNum (Revision Number) + // ChgID (Change ID) + // None (No Change Bar Message) + // UserDef (User Defined Message) + private LazyLoad _ChangeBarMessage; + public string ChangeBarMessage => LazyLoad(ref _ChangeBarMessage, "@ChangeBarMessage"); + // FixedChangeColumn + - Column location for change bars + // 0 - Separate AER and RNO change bars to the right of the text + // -10 to -1 - Change bars on left (specify # of columns from the text) + // <-10 - AER change bars on the left and RNO change bars on the right. + private LazyLoad _FixedChangeColumn; + public int? FixedChangeColumn => LazyLoad(ref _FixedChangeColumn, "@FixedChangeColumn"); + // specific location of change bars for text in AER column + // - appears to be used when FixedChageColumn is set to a number <-10 + private LazyLoad _FixedAERChangeColumn; + public int? FixedAERChangeColumn => LazyLoad(ref _FixedAERChangeColumn, "@FixedAERChangeColumn"); - // if the format has the absolutefixedchangecolumn format flag, then always use the fixedchangecolumn from the - // format, otherwise, use the default column based on the selected location, stored in the base format. - private LazyLoad _AbsoluteFixedChangeColumn; - public bool AbsoluteFixedChangeColumn - { - get - { - return LazyLoad(ref _AbsoluteFixedChangeColumn, "@AbsoluteFixedChangeColumn"); - } - } + // if the format has the absolutefixedchangecolumn format flag, then always use the fixedchangecolumn from the + // format, otherwise, use the default column based on the selected location, stored in the base format. + private LazyLoad _AbsoluteFixedChangeColumn; + public bool AbsoluteFixedChangeColumn => LazyLoad(ref _AbsoluteFixedChangeColumn, "@AbsoluteFixedChangeColumn"); - // Continue the change bar through the blank lines for consectutive changed steps - private LazyLoad _ContinuousChangeBars; - public bool ContinuousChangeBars - { - get - { - return LazyLoad(ref _ContinuousChangeBars, "@ContinuousChangeBars"); - } - } + // Continue the change bar through the blank lines for consectutive changed steps + private LazyLoad _ContinuousChangeBars; + public bool ContinuousChangeBars => LazyLoad(ref _ContinuousChangeBars, "@ContinuousChangeBars"); - // will allow user to type in a change ID text to be placed next to the the change bar for the piece of changed text - // user is prompted to enter a change ID when opening a procedure. - // A Change ID tab i placed on the procedure editor ribbon to allow the user to modify the change id entered - // upon opening the procedure - // an option on the step properties pannel allows user to modify the change id text for that piece of changed text. - private LazyLoad _ChangeIds; - public bool ChangeIds - { - get - { - return LazyLoad(ref _ChangeIds, "@ChangeIds"); - } - } - // extend the change bar that is on the last RNO step down to the RNO separator - // (only a couple plants and a RNO separator) - private LazyLoad _ChangeBarToRNOSep; - public bool ChangeBarToRNOSep - { - get - { - return LazyLoad(ref _ChangeBarToRNOSep, "@ChangeBarToRNOSep"); - } - } - - // don't do one continuous change bar when there are multiple Notes or Caution types next to each other - private LazyLoad _SeparateChangeBarsForDiffNotesCautions; - public bool SeparateChangeBarsForDiffNotesCautions - { - get - { - return LazyLoad(ref _SeparateChangeBarsForDiffNotesCautions, "@SeparateChangeBarsForDiffNotesCautions"); - } - } - } + // will allow user to type in a change ID text to be placed next to the the change bar for the piece of changed text + // user is prompted to enter a change ID when opening a procedure. + // A Change ID tab i placed on the procedure editor ribbon to allow the user to modify the change id entered + // upon opening the procedure + // an option on the step properties pannel allows user to modify the change id text for that piece of changed text. + private LazyLoad _ChangeIds; + public bool ChangeIds => LazyLoad(ref _ChangeIds, "@ChangeIds"); + // extend the change bar that is on the last RNO step down to the RNO separator + // (only a couple plants and a RNO separator) + private LazyLoad _ChangeBarToRNOSep; + public bool ChangeBarToRNOSep => LazyLoad(ref _ChangeBarToRNOSep, "@ChangeBarToRNOSep"); + + // don't do one continuous change bar when there are multiple Notes or Caution types next to each other + private LazyLoad _SeparateChangeBarsForDiffNotesCautions; + public bool SeparateChangeBarsForDiffNotesCautions => LazyLoad(ref _SeparateChangeBarsForDiffNotesCautions, "@SeparateChangeBarsForDiffNotesCautions"); + } #endregion #endregion #region SectDataAll @@ -2402,7 +1531,7 @@ namespace VEPROMS.CSLA.Library { get { - return (_ReplaceStrList == null) ? _ReplaceStrList = new ReplaceStrList(SelectNodes("ReplaceStrData/ReplaceStr")) : _ReplaceStrList; + return _ReplaceStrList ?? (_ReplaceStrList = new ReplaceStrList(SelectNodes("ReplaceStrData/ReplaceStr"))); } set { _ReplaceStrList = value; } } @@ -2411,7 +1540,7 @@ namespace VEPROMS.CSLA.Library { get { - return (_ReplaceSymbolCharList == null) ? _ReplaceSymbolCharList = new ReplaceSymbolCharList(SelectNodes("ReplaceSymbolChars/ReplaceChar"), MyFormat) : _ReplaceSymbolCharList; + return _ReplaceSymbolCharList ?? (_ReplaceSymbolCharList = new ReplaceSymbolCharList(SelectNodes("ReplaceSymbolChars/ReplaceChar"), MyFormat)); } set { _ReplaceSymbolCharList = value; } } @@ -2441,155 +1570,70 @@ namespace VEPROMS.CSLA.Library // - used when section number and title are printed on the same line via pagelist // - used for landscaped sections private LazyLoad _SectNumAndTlLenLand; // B2021-119: large titles on Landscape Word Attachments are printing on 2 lines. - public int? SectNumAndTlLenLand - { - get - { - return LazyLoad(ref _SectNumAndTlLenLand, "@SectNumAndTlLenLand"); - } - } + public int? SectNumAndTlLenLand => LazyLoad(ref _SectNumAndTlLenLand, "@SectNumAndTlLenLand"); - // flag to determine if the ReplaceWords logic will be run on non-Setpoint RO values - private LazyLoad _ReplaceWordsInROs; - public bool ReplaceWordsInROs - { - get - { - return LazyLoad(ref _ReplaceWordsInROs, "@ReplaceWordsInROs"); - } - } - // C2021-061: For Barakah don't do replace if word is surrounded by " or ' - // Initial fix was 11/3/21. Added parens do the quotes on 11/16/21 - private LazyLoad _NoReplaceQuoteParenWords; - public bool NoReplaceQuoteParenWords - { - get - { - return LazyLoad(ref _NoReplaceQuoteParenWords, "@NoReplaceQuoteParenWords"); - } - } + // flag to determine if the ReplaceWords logic will be run on non-Setpoint RO values + private LazyLoad _ReplaceWordsInROs; + public bool ReplaceWordsInROs => LazyLoad(ref _ReplaceWordsInROs, "@ReplaceWordsInROs"); + // C2021-061: For Barakah don't do replace if word is surrounded by " or ' + // Initial fix was 11/3/21. Added parens do the quotes on 11/16/21 + private LazyLoad _NoReplaceQuoteParenWords; + public bool NoReplaceQuoteParenWords => LazyLoad(ref _NoReplaceQuoteParenWords, "@NoReplaceQuoteParenWords"); - // When set to true, turns on the option to add sub-sections to non-Word sections - private LazyLoad _UseMetaSections; - public bool UseMetaSections - { - get - { - return LazyLoad(ref _UseMetaSections, "@UseMetaSections"); - } - } + // When set to true, turns on the option to add sub-sections to non-Word sections + private LazyLoad _UseMetaSections; + public bool UseMetaSections => LazyLoad(ref _UseMetaSections, "@UseMetaSections"); - // when printing count the sub-section level towards the step level - // - works only when the TieTabToLevel format flag is also true - private LazyLoad _CountSubSectionsForLevel; - public bool CountSubSectionsForLevel - { - get - { - return LazyLoad(ref _CountSubSectionsForLevel, "@CountSubSectionsForLevel"); - } - } + // when printing count the sub-section level towards the step level + // - works only when the TieTabToLevel format flag is also true + private LazyLoad _CountSubSectionsForLevel; + public bool CountSubSectionsForLevel => LazyLoad(ref _CountSubSectionsForLevel, "@CountSubSectionsForLevel"); - // prints a list of phone numbers at the bottom of the page - // - Calvert Cliffs - private LazyLoad _PrintPhoneList; - public bool PrintPhoneList - { - get - { - return LazyLoad(ref _PrintPhoneList, "@PrintPhoneList"); - } - } + // prints a list of phone numbers at the bottom of the page + // - Calvert Cliffs + private LazyLoad _PrintPhoneList; + public bool PrintPhoneList => LazyLoad(ref _PrintPhoneList, "@PrintPhoneList"); - // Set the default to NO for the automatic Indent of sub sections (this a a check box on the section properties page) - private LazyLoad _DefaultNoSubAutoIndent; - public bool DefaultNoSubAutoIndent - { - get - { - return LazyLoad(ref _DefaultNoSubAutoIndent, "@DefaultNoSubAutoIndent"); - } - } + // Set the default to NO for the automatic Indent of sub sections (this a a check box on the section properties page) + private LazyLoad _DefaultNoSubAutoIndent; + public bool DefaultNoSubAutoIndent => LazyLoad(ref _DefaultNoSubAutoIndent, "@DefaultNoSubAutoIndent"); - // convert the caret (^) to he delta symbol in Referenced Objects (RO) return values - private LazyLoad _ConvertCaretToDelta; - public bool ConvertCaretToDelta - { - get - { - return LazyLoad(ref _ConvertCaretToDelta, "@ConvertCaretToDelta"); - } - } + // convert the caret (^) to he delta symbol in Referenced Objects (RO) return values + private LazyLoad _ConvertCaretToDelta; + public bool ConvertCaretToDelta => LazyLoad(ref _ConvertCaretToDelta, "@ConvertCaretToDelta"); - //B2019-037 throw back from DOS VE-PROMS, convert "~" to subscript and "#" to superscript in RO return values - private LazyLoad _UseTildaPoundCharsForSuperSubScriptInROValues; - public bool UseTildaPoundCharsForSuperSubScriptInROValues - { - get - { - return LazyLoad(ref _UseTildaPoundCharsForSuperSubScriptInROValues, "@UseTildaPoundCharsForSuperSubScriptInROValues"); - } - } + //B2019-037 throw back from DOS VE-PROMS, convert "~" to subscript and "#" to superscript in RO return values + private LazyLoad _UseTildaPoundCharsForSuperSubScriptInROValues; + public bool UseTildaPoundCharsForSuperSubScriptInROValues => LazyLoad(ref _UseTildaPoundCharsForSuperSubScriptInROValues, "@UseTildaPoundCharsForSuperSubScriptInROValues"); - // C2022-021 will convert ">=" to the greater than or equal symbol, "<=" to the less than or equal symbol and "+-" to plus/minus symbol for RO return values - private LazyLoad _ConvertGTELTEPMinROValue; - public bool ConvertGTELTEPMinROValue - { - get - { - return LazyLoad(ref _ConvertGTELTEPMinROValue, "@ConvertGTELTEPMinROValue"); - } - } + // C2022-021 will convert ">=" to the greater than or equal symbol, "<=" to the less than or equal symbol and "+-" to plus/minus symbol for RO return values + private LazyLoad _ConvertGTELTEPMinROValue; + public bool ConvertGTELTEPMinROValue => LazyLoad(ref _ConvertGTELTEPMinROValue, "@ConvertGTELTEPMinROValue"); - // C2019-043 will convert "->" to the right arrow symbol and "<-" to the left arrow symbol - // for RO return values. - // was put in Barakah (BNPP) but found issue when RO was in a PROMS table cell, - // logic was added to no do this convert if in a table. - // BNPP decided to turned it off in altogether in their format files. - private LazyLoad _UseDashGreaterLessThenForArrowsInROValue; - public bool UseDashGreaterLessThenForArrowsInROValue - { - get - { - return LazyLoad(ref _UseDashGreaterLessThenForArrowsInROValue, "@UseDashGreaterLessThenForArrowsInROValue"); - } - } + // C2019-043 will convert "->" to the right arrow symbol and "<-" to the left arrow symbol + // for RO return values. + // was put in Barakah (BNPP) but found issue when RO was in a PROMS table cell, + // logic was added to no do this convert if in a table. + // BNPP decided to turned it off in altogether in their format files. + private LazyLoad _UseDashGreaterLessThenForArrowsInROValue; + public bool UseDashGreaterLessThenForArrowsInROValue => LazyLoad(ref _UseDashGreaterLessThenForArrowsInROValue, "@UseDashGreaterLessThenForArrowsInROValue"); - // Use only for RO return values placed in Word sections, the underbar character '_' - // will toggle underlining ON/OFF in the RO return value text - private LazyLoad _ConvertUnderscoreToUnderline; - public bool ConvertUnderscoreToUnderline - { - get - { - //B2017-256 - Value was not using _ConvertUnderscoreToUnderline - return LazyLoad(ref _ConvertUnderscoreToUnderline, "@ConvertUnderscoreToUnderline"); - } - } + // Use only for RO return values placed in Word sections, the underbar character '_' + // will toggle underlining ON/OFF in the RO return value text + private LazyLoad _ConvertUnderscoreToUnderline; + public bool ConvertUnderscoreToUnderline => LazyLoad(ref _ConvertUnderscoreToUnderline, "@ConvertUnderscoreToUnderline"); - // This format flag turns off the Replace Words functionality. - // in 16-bit proms, this was done simply by having an empty Replace Words list. - // in 32-bit the inheiradence logic finds a replace words list in the base format - // if the plant format does not have one. Thus the need of this format flag. - private LazyLoad _TurnOffReplaceWords; - public bool TurnOffReplaceWords - { - get - { - return LazyLoad(ref _TurnOffReplaceWords, "@TurnOffReplaceWords"); - } - } + // This format flag turns off the Replace Words functionality. + // in 16-bit proms, this was done simply by having an empty Replace Words list. + // in 32-bit the inheiradence logic finds a replace words list in the base format + // if the plant format does not have one. Thus the need of this format flag. + private LazyLoad _TurnOffReplaceWords; + public bool TurnOffReplaceWords => LazyLoad(ref _TurnOffReplaceWords, "@TurnOffReplaceWords"); - // B2022-002: Section text is printing into the INITIAL column (BNPP1new) - private LazyLoad _AdjWidthForCheckOff; - public bool AdjWidthForCheckOff - { - get - { - return LazyLoad(ref _AdjWidthForCheckOff, "@AdjWidthForCheckOff"); - } - } - } + // B2022-002: Section text is printing into the INITIAL column (BNPP1new) + private LazyLoad _AdjWidthForCheckOff; + public bool AdjWidthForCheckOff => LazyLoad(ref _AdjWidthForCheckOff, "@AdjWidthForCheckOff"); + } #endregion #region SectionNumber [TypeConverter(typeof(ExpandableObjectConverter))] @@ -2600,41 +1644,17 @@ namespace VEPROMS.CSLA.Library // starting position from the left margin inwhich to place the section number private LazyLoad _Pos; - public float? Pos - { - get - { - return LazyLoad(ref _Pos, "@Pos"); - } - } - // Left (PSLeft), Center (PSCenter) - // justification of the text for the starting position (Pos) - private LazyLoad _Just; - public string Just - { - get - { - return LazyLoad(ref _Just, "@Just"); - } - } - // only for a first level section, print using a font size of 14 and sytle of bold - private LazyLoad _Level0Big; - public bool Level0Big - { - get - { - return LazyLoad(ref _Level0Big, "@Level0Big"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } - } + public float? Pos => LazyLoad(ref _Pos, "@Pos"); + // Left (PSLeft), Center (PSCenter) + // justification of the text for the starting position (Pos) + private LazyLoad _Just; + public string Just => LazyLoad(ref _Just, "@Just"); + // only for a first level section, print using a font size of 14 and sytle of bold + private LazyLoad _Level0Big; + public bool Level0Big => LazyLoad(ref _Level0Big, "@Level0Big"); + private VE_Font _Font; + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); + } #endregion #region SectionHeader [TypeConverter(typeof(ExpandableObjectConverter))] @@ -2645,68 +1665,26 @@ namespace VEPROMS.CSLA.Library // starting position from the left margin inwhich to place the section number private LazyLoad _Pos; - public float? Pos - { - get - { - return LazyLoad(ref _Pos, "@Pos"); - } - } - // Left (PSLeft), Center (PSCenter) - // justification of the text for the starting position (Pos) - private LazyLoad _Just; - public string Just - { - get - { - return LazyLoad(ref _Just, "@Just"); - } - } - // only for a first level section, print using a font size of 14 and sytle of bold - private LazyLoad _Level0Big; - public bool Level0Big - { - get - { - return LazyLoad(ref _Level0Big, "@Level0Big"); - } - } - // Turn off underlining of section title for sub-sections - private LazyLoad _OnlyUnderlineTopSect; - public bool OnlyUnderlineTopSect - { - get - { - return LazyLoad(ref _OnlyUnderlineTopSect, "@OnlyUnderlineTopSect"); - } - } - //Turn off bolding of section title for sub-sections - private LazyLoad _OnlyBoldTopSect; - public bool OnlyBoldTopSect - { - get - { - return LazyLoad(ref _OnlyBoldTopSect, "@OnlyBoldTopSect"); - } - } - // If the section number is null or all blanks, then use the SectionNumber.Pos to position the section title - private LazyLoad _UseNumPosWhenNumBlank; - public bool UseNumPosWhenNumBlank - { - get - { - return LazyLoad(ref _UseNumPosWhenNumBlank, "@UseNumPosWhenNumBlank"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } - } + public float? Pos => LazyLoad(ref _Pos, "@Pos"); + // Left (PSLeft), Center (PSCenter) + // justification of the text for the starting position (Pos) + private LazyLoad _Just; + public string Just => LazyLoad(ref _Just, "@Just"); + // only for a first level section, print using a font size of 14 and sytle of bold + private LazyLoad _Level0Big; + public bool Level0Big => LazyLoad(ref _Level0Big, "@Level0Big"); + // Turn off underlining of section title for sub-sections + private LazyLoad _OnlyUnderlineTopSect; + public bool OnlyUnderlineTopSect => LazyLoad(ref _OnlyUnderlineTopSect, "@OnlyUnderlineTopSect"); + //Turn off bolding of section title for sub-sections + private LazyLoad _OnlyBoldTopSect; + public bool OnlyBoldTopSect => LazyLoad(ref _OnlyBoldTopSect, "@OnlyBoldTopSect"); + // If the section number is null or all blanks, then use the SectionNumber.Pos to position the section title + private LazyLoad _UseNumPosWhenNumBlank; + public bool UseNumPosWhenNumBlank => LazyLoad(ref _UseNumPosWhenNumBlank, "@UseNumPosWhenNumBlank"); + private VE_Font _Font; + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); + } #endregion #region SectionHeaderSeparatorLine [TypeConverter(typeof(ExpandableObjectConverter))] @@ -2717,23 +1695,11 @@ namespace VEPROMS.CSLA.Library // starting position, from the left margin, of the sparator line private LazyLoad _XStartPos; - public float? XStartPos - { - get - { - return LazyLoad(ref _XStartPos, "@XStartPos"); - } - } - // Length of the spearator line - private LazyLoad _Length; - public float? Length - { - get - { - return LazyLoad(ref _Length, "@Length"); - } - } - } + public float? XStartPos => LazyLoad(ref _XStartPos, "@XStartPos"); + // Length of the spearator line + private LazyLoad _Length; + public float? Length => LazyLoad(ref _Length, "@Length"); + } #endregion #region StepSectionDataAll @@ -2747,7 +1713,7 @@ namespace VEPROMS.CSLA.Library { get { - return (_TextTypeValueList == null) ? _TextTypeValueList = new TextTypeValueList(SelectNodes("TextTypeValue/short")) : _TextTypeValueList; + return _TextTypeValueList ?? (_TextTypeValueList = new TextTypeValueList(SelectNodes("TextTypeValue/short"))); } set { _TextTypeValueList = value; } } @@ -2756,7 +1722,7 @@ namespace VEPROMS.CSLA.Library { get { - return (_TextTypeList == null) ? _TextTypeList = new TextTypeList(SelectNodes("TextType/string")) : _TextTypeList; + return _TextTypeList ?? (_TextTypeList = new TextTypeList(SelectNodes("TextType/string"))); } set { _TextTypeList = value; } } @@ -2765,7 +1731,7 @@ namespace VEPROMS.CSLA.Library { get { - return (_UnderlineTerminateList == null) ? _UnderlineTerminateList = new UnderlineTerminateList(SelectNodes("UnderlineTerminate/string")) : _UnderlineTerminateList; + return _UnderlineTerminateList ?? (_UnderlineTerminateList = new UnderlineTerminateList(SelectNodes("UnderlineTerminate/string"))); } set { _UnderlineTerminateList = value; } } @@ -2774,7 +1740,7 @@ namespace VEPROMS.CSLA.Library { get { - return (_ObserveNCString1List == null) ? _ObserveNCString1List = new ObserveNCString1List(SelectNodes("ObserveNCString1/string")) : _ObserveNCString1List; + return _ObserveNCString1List ?? (_ObserveNCString1List = new ObserveNCString1List(SelectNodes("ObserveNCString1/string"))); } set { _ObserveNCString1List = value; } } @@ -2783,7 +1749,7 @@ namespace VEPROMS.CSLA.Library { get { - return (_ObserveNCString2List == null) ? _ObserveNCString2List = new ObserveNCString2List(SelectNodes("ObserveNCString2/string")) : _ObserveNCString2List; + return _ObserveNCString2List ?? (_ObserveNCString2List = new ObserveNCString2List(SelectNodes("ObserveNCString2/string"))); } set { _ObserveNCString2List = value; } } @@ -2792,251 +1758,113 @@ namespace VEPROMS.CSLA.Library { get { - return (_StepSectionLayoutData == null) ? _StepSectionLayoutData = new StepSectionLayoutData(SelectSingleNode("StpSectLayData")) : _StepSectionLayoutData; + return _StepSectionLayoutData ?? (_StepSectionLayoutData = new StepSectionLayoutData(SelectSingleNode("StpSectLayData"))); } } // a list of the sequential tab formatting based on the level of the step/sub-step private SeqTabFmtList _SeqTabFmtList; - public SeqTabFmtList SeqTabFmtList - { - get - { - return (_SeqTabFmtList == null) ? _SeqTabFmtList = new SeqTabFmtList(SelectNodes("SequentialTabFormat/SeqTabFmt"), MyFormat) : _SeqTabFmtList; - } - } - private StepSectionPrintData _StepSectionPrintData; - public StepSectionPrintData StepSectionPrintData - { - get - { - return (_StepSectionPrintData == null) ? _StepSectionPrintData = new StepSectionPrintData(SelectSingleNode("StpSectPrtData")) : _StepSectionPrintData; - } - } - // indent character used in RTF - // base format has this set to "0" which the code that uses this will resign this to "\x5" - private LazyLoad _IndentToken; - public string IndentToken - { - get - { - return LazyLoad(ref _IndentToken, "@IndentToken"); - } - } - // this is the default bullet character used for sub-step types that are indented and then use a bullet as the - // sub-step tab. Base format has this as a solid bullet (ascii character number 7), - // other plants use lower cased 'o' for an open bullet. - private LazyLoad _IdentB; - public string IdentB - { - get - { - return LazyLoad(ref _IdentB, "@IdentB"); - } - } - // special step tabbing and print formatting for enhanced background documennts - // - required by Wolf Creek's background format. - private LazyLoad _WolfCreekBackgroundFormat; - public bool WolfCreekBackgroundFormat - { - get - { - return LazyLoad(ref _WolfCreekBackgroundFormat, "@WolfCreekBackgroundFormat"); - } - } + public SeqTabFmtList SeqTabFmtList => _SeqTabFmtList ?? (_SeqTabFmtList = new SeqTabFmtList(SelectNodes("SequentialTabFormat/SeqTabFmt"), MyFormat)); + private StepSectionPrintData _StepSectionPrintData; + public StepSectionPrintData StepSectionPrintData => _StepSectionPrintData ?? (_StepSectionPrintData = new StepSectionPrintData(SelectSingleNode("StpSectPrtData"))); + // indent character used in RTF + // base format has this set to "0" which the code that uses this will resign this to "\x5" + private LazyLoad _IndentToken; + public string IndentToken => LazyLoad(ref _IndentToken, "@IndentToken"); + // this is the default bullet character used for sub-step types that are indented and then use a bullet as the + // sub-step tab. Base format has this as a solid bullet (ascii character number 7), + // other plants use lower cased 'o' for an open bullet. + private LazyLoad _IdentB; + public string IdentB => LazyLoad(ref _IdentB, "@IdentB"); + // special step tabbing and print formatting for enhanced background documennts + // - required by Wolf Creek's background format. + private LazyLoad _WolfCreekBackgroundFormat; + public bool WolfCreekBackgroundFormat => LazyLoad(ref _WolfCreekBackgroundFormat, "@WolfCreekBackgroundFormat"); - // special formatting of steps and sub-steps to create an on the fly table when printed - private LazyLoad _WolfcreekCKLFormat; - public bool WolfcreekCKLFormat - { - get - { - return LazyLoad(ref _WolfcreekCKLFormat, "@WolfcreekCKLFormat"); - } - } + // special formatting of steps and sub-steps to create an on the fly table when printed + private LazyLoad _WolfcreekCKLFormat; + public bool WolfcreekCKLFormat => LazyLoad(ref _WolfcreekCKLFormat, "@WolfcreekCKLFormat"); - // special formatting Vogtle Unit 3 and 4 Backgrounds: allows use of override width on AND and List sub-step types, - // and the calculation of the width of the paragraph sub-step type - private LazyLoad _Vogtle3and4BackgroundFormat; - public bool Vogtle3and4BackgroundFormat - { - get - { - return LazyLoad(ref _Vogtle3and4BackgroundFormat, "@Vogtle3and4BackgroundFormat"); - } - } + // special formatting Vogtle Unit 3 and 4 Backgrounds: allows use of override width on AND and List sub-step types, + // and the calculation of the width of the paragraph sub-step type + private LazyLoad _Vogtle3and4BackgroundFormat; + public bool Vogtle3and4BackgroundFormat => LazyLoad(ref _Vogtle3and4BackgroundFormat, "@Vogtle3and4BackgroundFormat"); - // This translates into nx10x10y where y is superscripted. - // For example, .E3 -> x103 where 3 is superscripted - // and 10.E5 -> 10x10-5 where 5 is superscripted - private LazyLoad _FortranFormatNumbers; - public bool FortranFormatNumbers - { - get - { - return LazyLoad(ref _FortranFormatNumbers, "@FortranFormatNumbers"); - } - } + // This translates into nx10x10y where y is superscripted. + // For example, .E3 -> x103 where 3 is superscripted + // and 10.E5 -> 10x10-5 where 5 is superscripted + private LazyLoad _FortranFormatNumbers; + public bool FortranFormatNumbers => LazyLoad(ref _FortranFormatNumbers, "@FortranFormatNumbers"); - // FloatingContinueMessage format flag: - // if breaking at the AER put continue message in left column, - // if breaking RNO put continue message in Right column. - private LazyLoad _FloatingContinueMessage; - public bool FloatingContinueMessage - { - get - { - return LazyLoad(ref _FloatingContinueMessage, "@FloatingContinueMessage"); - } - } + // FloatingContinueMessage format flag: + // if breaking at the AER put continue message in left column, + // if breaking RNO put continue message in Right column. + private LazyLoad _FloatingContinueMessage; + public bool FloatingContinueMessage => LazyLoad(ref _FloatingContinueMessage, "@FloatingContinueMessage"); - // used when section title is not printed via the pagelist, will print the title with "continued" - // appended to it when the section print multiple pages - private LazyLoad _ContinueSectionHeader; - public bool ContinueSectionHeader - { - get - { - return LazyLoad(ref _ContinueSectionHeader, "@ContinueSectionHeader"); - } - } + // used when section title is not printed via the pagelist, will print the title with "continued" + // appended to it when the section print multiple pages + private LazyLoad _ContinueSectionHeader; + public bool ContinueSectionHeader => LazyLoad(ref _ContinueSectionHeader, "@ContinueSectionHeader"); - // the font size of the text that is sub-scripted is made smaller - private LazyLoad _CompressHPSub; - public bool CompressHPSub - { - get - { - return LazyLoad(ref _CompressHPSub, "@CompressHPSub"); - } - } + // the font size of the text that is sub-scripted is made smaller + private LazyLoad _CompressHPSub; + public bool CompressHPSub => LazyLoad(ref _CompressHPSub, "@CompressHPSub"); - // the font size of the text that is super-scripted is made smaller - private LazyLoad _CompressHPSuper; - public bool CompressHPSuper - { - get - { - return LazyLoad(ref _CompressHPSuper, "@CompressHPSuper"); - } - } + // the font size of the text that is super-scripted is made smaller + private LazyLoad _CompressHPSuper; + public bool CompressHPSuper => LazyLoad(ref _CompressHPSuper, "@CompressHPSuper"); - // special handling of super and sub scripts when the font is a proportial font - private LazyLoad _CompressPropSubSup; - public bool CompressPropSubSup - { - get - { - return LazyLoad(ref _CompressPropSubSup, "@CompressPropSubSup"); - } - } + // special handling of super and sub scripts when the font is a proportial font + private LazyLoad _CompressPropSubSup; + public bool CompressPropSubSup => LazyLoad(ref _CompressPropSubSup, "@CompressPropSubSup"); - // used in Ginna's Attachment format - // adjust the width of the Cautions and Note to not exend page the end of the HLS width - // ie, shorten the width if the Caution or Note is off of a sub-step - private LazyLoad _LimitCautionNoteWithToHLS; - public bool LimitCautionNoteWidthToHLS - { - get - { - return LazyLoad(ref _LimitCautionNoteWithToHLS, "@LimitCautionNoteWithToHLS"); - } - } - // Used in Ginn's Attachment format - // only bullet multiple Caution/Note types if they are exactly the same type (ex. CAUTION vs CAUTION1) - private LazyLoad _OnlyBulletSameCautionNoteType; - public bool OnlyBulletSameCautionNoteType - { - get - { - return LazyLoad(ref _OnlyBulletSameCautionNoteType, "@OnlyBulletSameCautionNoteType"); - } - } + // used in Ginna's Attachment format + // adjust the width of the Cautions and Note to not exend page the end of the HLS width + // ie, shorten the width if the Caution or Note is off of a sub-step + private LazyLoad _LimitCautionNoteWithToHLS; + public bool LimitCautionNoteWidthToHLS => LazyLoad(ref _LimitCautionNoteWithToHLS, "@LimitCautionNoteWithToHLS"); + // Used in Ginn's Attachment format + // only bullet multiple Caution/Note types if they are exactly the same type (ex. CAUTION vs CAUTION1) + private LazyLoad _OnlyBulletSameCautionNoteType; + public bool OnlyBulletSameCautionNoteType => LazyLoad(ref _OnlyBulletSameCautionNoteType, "@OnlyBulletSameCautionNoteType"); - // ImperfectStructure is used so that the sequential numbering for substeps under an RNO is not same - // numbering (alpha vs numeric), if the HLS has substeps - WCN uses this, as well as other plants. - // skips the step tab level ahead by 2 more - private LazyLoad _ImperfectStructure; - public bool ImperfectStructure - { - get - { - return LazyLoad(ref _ImperfectStructure, "@ImperfectStructure"); - } - } + // ImperfectStructure is used so that the sequential numbering for substeps under an RNO is not same + // numbering (alpha vs numeric), if the HLS has substeps - WCN uses this, as well as other plants. + // skips the step tab level ahead by 2 more + private LazyLoad _ImperfectStructure; + public bool ImperfectStructure => LazyLoad(ref _ImperfectStructure, "@ImperfectStructure"); - // like imperfectStructure, but only for the first level RNO - private LazyLoad _ImperfectSubstep; - public bool ImperfectSubstep - { - get - { - return LazyLoad(ref _ImperfectSubstep, "@ImperfectSubstep"); - } - } + // like imperfectStructure, but only for the first level RNO + private LazyLoad _ImperfectSubstep; + public bool ImperfectSubstep => LazyLoad(ref _ImperfectSubstep, "@ImperfectSubstep"); - // used with ImperfectStructure, skips the step tab level ahead by 2 more (for a total of 4) - private LazyLoad _ImperfectStructurePlus4; - public bool ImperfectStructurePlus4 - { - get - { - return LazyLoad(ref _ImperfectStructurePlus4, "@ImperfectStructurePlus4"); - } - } + // used with ImperfectStructure, skips the step tab level ahead by 2 more (for a total of 4) + private LazyLoad _ImperfectStructurePlus4; + public bool ImperfectStructurePlus4 => LazyLoad(ref _ImperfectStructurePlus4, "@ImperfectStructurePlus4"); - // When the sub-step tab include it's parent tab, this flag will ignor any step/sub-step tabs that are not a number or letter - private LazyLoad _SkipNonSeqTabWithPar; - public bool SkipNonSeqTabWithPar - { - get - { - return LazyLoad(ref _SkipNonSeqTabWithPar, "@SkipNonSeqTabWithPar"); - } - } + // When the sub-step tab include it's parent tab, this flag will ignor any step/sub-step tabs that are not a number or letter + private LazyLoad _SkipNonSeqTabWithPar; + public bool SkipNonSeqTabWithPar => LazyLoad(ref _SkipNonSeqTabWithPar, "@SkipNonSeqTabWithPar"); - // when determining the sub-step level (for tabs and printing), count only sequential sub-steps (excluding RNOs, Cautions, and Notes - private LazyLoad _CountAllSubLevels; - public bool CountAllSubLevels - { - get - { - return LazyLoad(ref _CountAllSubLevels, "@CountAllSubLevels"); - } - } + // when determining the sub-step level (for tabs and printing), count only sequential sub-steps (excluding RNOs, Cautions, and Notes + private LazyLoad _CountAllSubLevels; + public bool CountAllSubLevels => LazyLoad(ref _CountAllSubLevels, "@CountAllSubLevels"); - // don't reset (remove) the indent (RTF indent char) on step text when there are hard returns - private LazyLoad _DontResetIndentOnNewline; - public bool DontResetIndentOnNewline - { - get - { - return LazyLoad(ref _DontResetIndentOnNewline, "@DontResetIndentOnNewline"); - } - } + // don't reset (remove) the indent (RTF indent char) on step text when there are hard returns + private LazyLoad _DontResetIndentOnNewline; + public bool DontResetIndentOnNewline => LazyLoad(ref _DontResetIndentOnNewline, "@DontResetIndentOnNewline"); - // C2018-024 I in Arial font changed to I in TimesNewRoman - // put in for McGuire (MCGall format) - private LazyLoad _ChangeFontUpperCaseIinArial; - public bool ChangeFontUpperCaseIinArial - { - get - { - return LazyLoad(ref _ChangeFontUpperCaseIinArial, "@ChangeFontUpperCaseIinArial"); - } - } + // C2018-024 I in Arial font changed to I in TimesNewRoman + // put in for McGuire (MCGall format) + private LazyLoad _ChangeFontUpperCaseIinArial; + public bool ChangeFontUpperCaseIinArial => LazyLoad(ref _ChangeFontUpperCaseIinArial, "@ChangeFontUpperCaseIinArial"); - // F2024-080 South Texas - // Used to show if "Initial Line Disable" checkbox should show in the DisplayTab - private LazyLoad _ShowInitialLineDisable; - public bool ShowInitialLineDisable - { - get - { - return LazyLoad(ref _ShowInitialLineDisable, "@ShowInitialLineDisable"); - } - } - } + // F2024-080 South Texas + // Used to show if "Initial Line Disable" checkbox should show in the DisplayTab + private LazyLoad _ShowInitialLineDisable; + public bool ShowInitialLineDisable => LazyLoad(ref _ShowInitialLineDisable, "@ShowInitialLineDisable"); + } #endregion - StepSectionData #region TextTypeValue [TypeConverter(typeof(ExpandableObjectConverter))] @@ -3045,24 +1873,12 @@ namespace VEPROMS.CSLA.Library public TextTypeValue(XmlNode xmlNode) : base(xmlNode) { } public TextTypeValue() : base() { } private LazyLoad _TheValue; - public int? TheValue - { - get - { - return LazyLoad(ref _TheValue, "text()"); - } - } - public override string GetPDDisplayName() - { return "Value"; } - public override string GetPDDescription() - { return string.Format("TextTypeValue '{0}'", TheValue); } - public override string GetPDCategory() - { return "Text Type Value"; } - public override string ToString() - { - return TheValue.ToString(); - } - } + public int? TheValue => LazyLoad(ref _TheValue, "text()"); + public override string GetPDDisplayName() => "Value"; + public override string GetPDDescription() => string.Format("TextTypeValue '{0}'", TheValue); + public override string GetPDCategory() => "Text Type Value"; + public override string ToString() => TheValue.ToString(); + } #endregion - TextTypeValue #region TextTypeValueList [TypeConverter(typeof(vlnListConverter))] @@ -3079,24 +1895,12 @@ namespace VEPROMS.CSLA.Library public TextType() : base() { } //[Category("Strings")] private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("TextType '{0}'", Text); } - public override string GetPDCategory() - { return "Text Type"; } - public override string ToString() - { - return Text; - } - } + public string Text => LazyLoad(ref _Text, "text()"); + public override string GetPDDisplayName() => "Text"; + public override string GetPDDescription() => string.Format("TextType '{0}'", Text); + public override string GetPDCategory() => "Text Type"; + public override string ToString() => Text; + } #endregion - TextType #region TextTypeList [TypeConverter(typeof(vlnListConverter))] @@ -3112,24 +1916,12 @@ namespace VEPROMS.CSLA.Library public UnderlineTerminate(XmlNode xmlNode) : base(xmlNode) { } public UnderlineTerminate() : base() { } private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("UnderlineTerminate '{0}'", Text); } - public override string GetPDCategory() - { return "Underline Terminate"; } - public override string ToString() - { - return Text; - } - } + public string Text => LazyLoad(ref _Text, "text()"); + public override string GetPDDisplayName() => "Text"; + public override string GetPDDescription() => string.Format("UnderlineTerminate '{0}'", Text); + public override string GetPDCategory() => "Underline Terminate"; + public override string ToString() => Text; + } #endregion - UnderlineTerminate #region UnderlineTerminateList [TypeConverter(typeof(vlnListConverter))] @@ -3145,24 +1937,12 @@ namespace VEPROMS.CSLA.Library public ObserveNCString1(XmlNode xmlNode) : base(xmlNode) { } public ObserveNCString1() : base() { } private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("ObserveNCString1 '{0}'", Text); } - public override string GetPDCategory() - { return "ObserveNCString1"; } - public override string ToString() - { - return Text; - } - } + public string Text => LazyLoad(ref _Text, "text()"); + public override string GetPDDisplayName() => "Text"; + public override string GetPDDescription() => string.Format("ObserveNCString1 '{0}'", Text); + public override string GetPDCategory() => "ObserveNCString1"; + public override string ToString() => Text; + } #endregion - ObserveNCString1 #region ObserveNCString1List [TypeConverter(typeof(vlnListConverter))] @@ -3178,24 +1958,12 @@ namespace VEPROMS.CSLA.Library public ObserveNCString2(XmlNode xmlNode) : base(xmlNode) { } public ObserveNCString2() : base() { } private LazyLoad _Text; - public string Text - { - get - { - return LazyLoad(ref _Text, "text()"); - } - } - public override string GetPDDisplayName() - { return "Text"; } - public override string GetPDDescription() - { return string.Format("ObserveNCString2 '{0}'", Text); } - public override string GetPDCategory() - { return "ObserveNCString2"; } - public override string ToString() - { - return Text; - } - } + public string Text => LazyLoad(ref _Text, "text()"); + public override string GetPDDisplayName() => "Text"; + public override string GetPDDescription() => string.Format("ObserveNCString2 '{0}'", Text); + public override string GetPDCategory() => "ObserveNCString2"; + public override string ToString() => Text; + } #endregion - ObserveNCString2 #region ObserveNCString2List [TypeConverter(typeof(vlnListConverter))] @@ -3219,47 +1987,23 @@ namespace VEPROMS.CSLA.Library // the string what will be replaced private LazyLoad _ReplaceWord; - public string ReplaceWord - { - get - { - return LazyLoad(ref _ReplaceWord, "@ReplaceWord"); - } - } - [Category("Strings")] + public string ReplaceWord => LazyLoad(ref _ReplaceWord, "@ReplaceWord"); + [Category("Strings")] // string to use for the replacement private LazyLoad _ReplaceWith; - public string ReplaceWith - { - get - { - return LazyLoad(ref _ReplaceWith, "@ReplaceWith"); - } - } - // flags to control where the replacement is allowed: - // ex: "High, RNO, Caution, Note, Table, Substep, Attach" - // see E_ReplaceFlags in "CSLA.Library\Format\ENums.cs" for the complete list + public string ReplaceWith => LazyLoad(ref _ReplaceWith, "@ReplaceWith"); + // flags to control where the replacement is allowed: + // ex: "High, RNO, Caution, Note, Table, Substep, Attach" + // see E_ReplaceFlags in "CSLA.Library\Format\ENums.cs" for the complete list - private LazyLoad _Flag; - public E_ReplaceFlags? Flag - { - get - { - return LazyLoad(ref _Flag, "@Flag"); - } - } - public override string GetPDDisplayName() - { return ReplaceWord; } - public override string GetPDDescription() - { return string.Format("Replace '{0}' with '{1}'", ReplaceWord, ReplaceWith); } - public override string GetPDCategory() - { return "Words to Replace"; } - public override string ToString() - { - return ReplaceWith; - } - } + private LazyLoad _Flag; + public E_ReplaceFlags? Flag => LazyLoad(ref _Flag, "@Flag"); + public override string GetPDDisplayName() => ReplaceWord; + public override string GetPDDescription() => string.Format("Replace '{0}' with '{1}'", ReplaceWord, ReplaceWith); + public override string GetPDCategory() => "Words to Replace"; + public override string ToString() => ReplaceWith; + } #endregion - ReplaceStr #region ReplaceStrList @@ -3279,47 +2023,23 @@ namespace VEPROMS.CSLA.Library // A unique index number for this symbol list private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - [Category("Strings")] + public int? Index => LazyLoad(ref _Index, "@Index"); + [Category("Strings")] //The Unicode number of the symbol we are replacing private LazyLoad _Unicode; - public string Unicode - { - get - { - return LazyLoad(ref _Unicode, "@Unicode"); - } - } - [Category("Strings")] + public string Unicode => LazyLoad(ref _Unicode, "@Unicode"); + [Category("Strings")] //The Unicode number of the symbol we want to use instead (this is optional) private LazyLoad _Replace; - public string Replace - { - get - { - return LazyLoad(ref _Replace, "@Replace"); - } - } - [Category("Strings")] + public string Replace => LazyLoad(ref _Replace, "@Replace"); + [Category("Strings")] // The font family of the replacement symbol character (this is optional) private LazyLoad _Family; - public string Family - { - get - { - return LazyLoad(ref _Family, "@Family"); - } - } - [Category("FontStyle?")] + public string Family => LazyLoad(ref _Family, "@Family"); + [Category("FontStyle?")] // the font style for the symbol character (bold, Italics, Underline) - this is optional private LazyLoad _Style; // format has E_Style value. The public will translate it to a systemdrawing.FontStyle used in printing public FontStyle? Style @@ -3346,24 +2066,12 @@ namespace VEPROMS.CSLA.Library // The font size of the replacement symbol character (this is optional) private LazyLoad _Size; - public float? Size - { - get - { - return LazyLoad(ref _Size, "@Size"); - } - } - public override string GetPDDisplayName() - { return Unicode; } - public override string GetPDDescription() - { return string.Format("Replace '{0}' with '{1}'", Unicode, Replace); } - public override string GetPDCategory() - { return "Chars to Replace"; } - public override string ToString() - { - return Replace; - } - } + public float? Size => LazyLoad(ref _Size, "@Size"); + public override string GetPDDisplayName() => Unicode; + public override string GetPDDescription() => string.Format("Replace '{0}' with '{1}'", Unicode, Replace); + public override string GetPDCategory() => "Chars to Replace"; + public override string ToString() => Replace; + } #endregion - ReplaceChar #region ReplaceSymbolCharList @@ -3390,278 +2098,116 @@ namespace VEPROMS.CSLA.Library // the font and placement settings for the separator words used for OR the sub-steps // and the Explicit And sub-steps private Separator _Separator; - public Separator Separator - { - get - { - return (_Separator == null) ? _Separator = new Separator(SelectSingleNode("Separator")) : _Separator; - } - } - // the size of a tab in points. If not set, then 6 points will be used. - // note - don't add and set this to Base format, some code check for no value set - private LazyLoad _TabPtsPerChar; - public float? TabPtsPerChar - { - get - { - return LazyLoad(ref _TabPtsPerChar, "@TabPtsPerChar"); - } - } - // will define the placement of Notes, Cautions, and Warning with repect to the step they apply - // value is a string containing a list of StepData Index numbers for the defined Cautions and Notes types - a Warning is a redifined Caution or Note - private LazyLoad _CautionNoteOrder; - public string CautionNoteOrder - { - get - { - return LazyLoad(ref _CautionNoteOrder, "@CautionNoteOrder"); - } - } + public Separator Separator => _Separator ?? (_Separator = new Separator(SelectSingleNode("Separator"))); + // the size of a tab in points. If not set, then 6 points will be used. + // note - don't add and set this to Base format, some code check for no value set + private LazyLoad _TabPtsPerChar; + public float? TabPtsPerChar => LazyLoad(ref _TabPtsPerChar, "@TabPtsPerChar"); + // will define the placement of Notes, Cautions, and Warning with repect to the step they apply + // value is a string containing a list of StepData Index numbers for the defined Cautions and Notes types - a Warning is a redifined Caution or Note + private LazyLoad _CautionNoteOrder; + public string CautionNoteOrder => LazyLoad(ref _CautionNoteOrder, "@CautionNoteOrder"); - // starting position for High Level step text from the left margin - private LazyLoad _ColS; - public float? ColS - { - get - { - return LazyLoad(ref _ColS, "@ColS"); - } - } + // starting position for High Level step text from the left margin + private LazyLoad _ColS; + public float? ColS => LazyLoad(ref _ColS, "@ColS"); - // starting positon for cautions and notes that do not have a border (box format associated to it) - private LazyLoad _ColT; - public float? ColT - { - get - { - return LazyLoad(ref _ColT, "@ColT"); - } - } + // starting positon for cautions and notes that do not have a border (box format associated to it) + private LazyLoad _ColT; + public float? ColT => LazyLoad(ref _ColT, "@ColT"); - // Width of Text (note/caution) fields. This is overridden by BxTxtWidth, if the text is boxed. - private LazyLoad _WidT; - public float? WidT - { - get - { - return LazyLoad(ref _WidT, "@WidT"); - } - } + // Width of Text (note/caution) fields. This is overridden by BxTxtWidth, if the text is boxed. + private LazyLoad _WidT; + public float? WidT => LazyLoad(ref _WidT, "@WidT"); - // default column mode of the step editor sections - used in Section Properties - // if PMode is zero, the default column mode is two column - private LazyLoad _PMode; - public int? PMode - { - get - { - return LazyLoad(ref _PMode, "@PMode"); - } - } + // default column mode of the step editor sections - used in Section Properties + // if PMode is zero, the default column mode is two column + private LazyLoad _PMode; + public int? PMode => LazyLoad(ref _PMode, "@PMode"); - // default column mode of the step editor sections - used in Procedure Properties - private LazyLoad _ColumnMode; - public int? ColumnMode - { - get - { - return LazyLoad(ref _ColumnMode, "@ColumnMode"); - } - } - // set the width of RNO text to be same as its parent - put in for V.C. Summer (SUM formats) - private LazyLoad _RNOWidthSameAsHighParent; - public bool RNOWidthSameAsHighParent - { - get - { - return LazyLoad(ref _RNOWidthSameAsHighParent, "@RNOWidthSameAsHighParent"); - } - } - // used with the RNOWidthSameAsHighParent flag, is width value if this is the top RNO (parent RNO) - // - put in for V.C. Summer (SUM formats) - private LazyLoad _SingleColumnRNOIndent; - public float? SingleColumnRNOIndent - { - get - { - return LazyLoad(ref _SingleColumnRNOIndent, "@SingleColumnRNOIndent"); - } - } + // default column mode of the step editor sections - used in Procedure Properties + private LazyLoad _ColumnMode; + public int? ColumnMode => LazyLoad(ref _ColumnMode, "@ColumnMode"); + // set the width of RNO text to be same as its parent - put in for V.C. Summer (SUM formats) + private LazyLoad _RNOWidthSameAsHighParent; + public bool RNOWidthSameAsHighParent => LazyLoad(ref _RNOWidthSameAsHighParent, "@RNOWidthSameAsHighParent"); + // used with the RNOWidthSameAsHighParent flag, is width value if this is the top RNO (parent RNO) + // - put in for V.C. Summer (SUM formats) + private LazyLoad _SingleColumnRNOIndent; + public float? SingleColumnRNOIndent => LazyLoad(ref _SingleColumnRNOIndent, "@SingleColumnRNOIndent"); - // B2020-140 for Wolf Creek check boxes in tables were printing too high in the table cells - added format variable to overide topPlacementAdjust (WCN format files) - private LazyLoad _OverrideTableTopIndent; - public int? OverrideTableTopIndent - { - get - { - return LazyLoad(ref _OverrideTableTopIndent, "@OverrideTableTopIndent"); - } - } - // the space between columns of the procedure text (between AER and RNO columns) - private LazyLoad _ColRTable; - public string ColRTable - { - get - { - return LazyLoad(ref _ColRTable, "@ColRTable"); - } - } + // B2020-140 for Wolf Creek check boxes in tables were printing too high in the table cells - added format variable to overide topPlacementAdjust (WCN format files) + private LazyLoad _OverrideTableTopIndent; + public int? OverrideTableTopIndent => LazyLoad(ref _OverrideTableTopIndent, "@OverrideTableTopIndent"); + // the space between columns of the procedure text (between AER and RNO columns) + private LazyLoad _ColRTable; + public string ColRTable => LazyLoad(ref _ColRTable, "@ColRTable"); - // the high level step text width, in the PROMS editor, based on on many columns the procedure has - private LazyLoad _WidSTableEdit; - public string WidSTableEdit - { - get - { - return LazyLoad(ref _WidSTableEdit, "@WidSTableEdit"); - } - } + // the high level step text width, in the PROMS editor, based on on many columns the procedure has + private LazyLoad _WidSTableEdit; + public string WidSTableEdit => LazyLoad(ref _WidSTableEdit, "@WidSTableEdit"); - // the high level step text width, when printed, based on on many columns the procedure has - private LazyLoad _WidSTablePrint; - public string WidSTablePrint - { - get - { - return LazyLoad(ref _WidSTablePrint, "@WidSTablePrint"); - } - } + // the high level step text width, when printed, based on on many columns the procedure has + private LazyLoad _WidSTablePrint; + public string WidSTablePrint => LazyLoad(ref _WidSTablePrint, "@WidSTablePrint"); - // Adjust the RNO width off the high level step - private LazyLoad _RNOWidthAlt; - public string RNOWidthAlt - { - get - { - return LazyLoad(ref _RNOWidthAlt, "@RNOWidthAlt"); - } - } + // Adjust the RNO width off the high level step + private LazyLoad _RNOWidthAlt; + public string RNOWidthAlt => LazyLoad(ref _RNOWidthAlt, "@RNOWidthAlt"); - // adjust the RNO width for all RNOs - D.C. Cook (AEP formats) - private LazyLoad _RNOWidthAltAll; - public int? RNOWidthAltAll - { - get - { - return LazyLoad(ref _RNOWidthAltAll, "@RNOWidthAltAll"); - } - } - // adjust the width of the RNO off of an AER sub-step - private LazyLoad _RNOWidthAdj; - public string RNOWidthAdj - { - get - { - return LazyLoad(ref _RNOWidthAdj, "@RNOWidthAdj"); - } - } + // adjust the RNO width for all RNOs - D.C. Cook (AEP formats) + private LazyLoad _RNOWidthAltAll; + public int? RNOWidthAltAll => LazyLoad(ref _RNOWidthAltAll, "@RNOWidthAltAll"); + // adjust the width of the RNO off of an AER sub-step + private LazyLoad _RNOWidthAdj; + public string RNOWidthAdj => LazyLoad(ref _RNOWidthAdj, "@RNOWidthAdj"); - // Use the parent's RNO indent - private LazyLoad _UseRNOParentIdent; - public string UseRNOParentIdent - { - get - { - return LazyLoad(ref _UseRNOParentIdent, "@UseRNOParentIdent"); - } - } - // Adjusts the placement of the Note and Caution tabs in deviations - private LazyLoad _DevNoteOrCautionTabOffset; - public string DevNoteOrCautionTabOffset - { - get - { - return LazyLoad(ref _DevNoteOrCautionTabOffset, "@DevNoteOrCautionTabOffset"); - } - } + // Use the parent's RNO indent + private LazyLoad _UseRNOParentIdent; + public string UseRNOParentIdent => LazyLoad(ref _UseRNOParentIdent, "@UseRNOParentIdent"); + // Adjusts the placement of the Note and Caution tabs in deviations + private LazyLoad _DevNoteOrCautionTabOffset; + public string DevNoteOrCautionTabOffset => LazyLoad(ref _DevNoteOrCautionTabOffset, "@DevNoteOrCautionTabOffset"); - // adjustment to the starting positoin of the note/caution boxes - // - this is used sub-formats for Byron and Braidwood (CEW_00, EXCLN01) - private LazyLoad _BoxLeftAdj; - public string BoxLeftAdj - { - get - { - return LazyLoad(ref _BoxLeftAdj, "@BoxLeftAdj"); - } - } + // adjustment to the starting positoin of the note/caution boxes + // - this is used sub-formats for Byron and Braidwood (CEW_00, EXCLN01) + private LazyLoad _BoxLeftAdj; + public string BoxLeftAdj => LazyLoad(ref _BoxLeftAdj, "@BoxLeftAdj"); - // B2019-049 added check for table being in a Caution or Note - if so, use the single column setting for the format variable TableCenterPos - private LazyLoad _TableCenterPos; - public string TableCenterPos - { - get - { - return LazyLoad(ref _TableCenterPos, "@TableCenterPos"); - } - } + // B2019-049 added check for table being in a Caution or Note - if so, use the single column setting for the format variable TableCenterPos + private LazyLoad _TableCenterPos; + public string TableCenterPos => LazyLoad(ref _TableCenterPos, "@TableCenterPos"); - // Turn on editing and printing format for Deviation Documents (non-enhanced document) - // uses the Caution and Note type for the EOP and ERG step number, the widths are reduced - // and they are placed to the left of the high level step text - private LazyLoad _Dev_Format; - public bool Dev_Format - { - get - { - return LazyLoad(ref _Dev_Format, "@Dev_Format"); - } - } - // links procedure step number and text (also links Cautions and Note). Uses a template for the step editor to enter deviation and support text (like enhanced backgrounds). Prints like the non-enhanced deviation document - private LazyLoad _EnhancedShortFormDev; - public bool EnhancedShortFormDev - { - get - { - return LazyLoad(ref _EnhancedShortFormDev, "@EnhancedShortFormDev"); - } - } + // Turn on editing and printing format for Deviation Documents (non-enhanced document) + // uses the Caution and Note type for the EOP and ERG step number, the widths are reduced + // and they are placed to the left of the high level step text + private LazyLoad _Dev_Format; + public bool Dev_Format => LazyLoad(ref _Dev_Format, "@Dev_Format"); + // links procedure step number and text (also links Cautions and Note). Uses a template for the step editor to enter deviation and support text (like enhanced backgrounds). Prints like the non-enhanced deviation document + private LazyLoad _EnhancedShortFormDev; + public bool EnhancedShortFormDev => LazyLoad(ref _EnhancedShortFormDev, "@EnhancedShortFormDev"); - // this flag is set in the plant format file when you want to be able to break steps that begin in the - // middle of the page. If this flag is not set, then any step that will not fit on a single page will - // cause a page break, i.e. start at the top of the next page. - private LazyLoad _SpecialPageBreakFlag; - public bool SpecialPageBreakFlag - { - get - { - return LazyLoad(ref _SpecialPageBreakFlag, "@SpecialPageBreakFlag"); - } - } + // this flag is set in the plant format file when you want to be able to break steps that begin in the + // middle of the page. If this flag is not set, then any step that will not fit on a single page will + // cause a page break, i.e. start at the top of the next page. + private LazyLoad _SpecialPageBreakFlag; + public bool SpecialPageBreakFlag => LazyLoad(ref _SpecialPageBreakFlag, "@SpecialPageBreakFlag"); - // paginate on a step if the entire step will fit on it's own page but not fit on the remainer of the current page - private LazyLoad _PaginateOnStepThatWillFitOnBlankPage; - public bool PaginateOnStepThatWillFitOnBlankPage - { - get - { - return LazyLoad(ref _PaginateOnStepThatWillFitOnBlankPage, "@PaginateOnStepThatWillFitOnBlankPage"); - } - } + // paginate on a step if the entire step will fit on it's own page but not fit on the remainer of the current page + private LazyLoad _PaginateOnStepThatWillFitOnBlankPage; + public bool PaginateOnStepThatWillFitOnBlankPage => LazyLoad(ref _PaginateOnStepThatWillFitOnBlankPage, "@PaginateOnStepThatWillFitOnBlankPage"); - // allows the first child to be separated from its parent - private LazyLoad _PaginateOnFirstSubstep; - public bool PaginateOnFirstSubstep - { - get - { - return LazyLoad(ref _PaginateOnFirstSubstep, "@PaginateOnFirstSubstep"); - } - } + // allows the first child to be separated from its parent + private LazyLoad _PaginateOnFirstSubstep; + public bool PaginateOnFirstSubstep => LazyLoad(ref _PaginateOnFirstSubstep, "@PaginateOnFirstSubstep"); - // keep the table's parent with the table (if at all possible, don't break the table from the parent) - private LazyLoad _PageBreakParentWithTable; // B2020-101: Add format flag for table pagination - public bool PageBreakParentWithTable - { - get - { - return LazyLoad(ref _PageBreakParentWithTable, "@PageBreakParentWithTable"); - } - } + // keep the table's parent with the table (if at all possible, don't break the table from the parent) + private LazyLoad _PageBreakParentWithTable; // B2020-101: Add format flag for table pagination + public bool PageBreakParentWithTable => LazyLoad(ref _PageBreakParentWithTable, "@PageBreakParentWithTable"); - // when needed to fit an entire step on a page, PROMS will print the step at 7 lines per inch instead of the standard 6 lines per inch - private LazyLoad _CompressSteps; + // when needed to fit an entire step on a page, PROMS will print the step at 7 lines per inch instead of the standard 6 lines per inch + private LazyLoad _CompressSteps; public bool CompressSteps { get @@ -3676,168 +2222,78 @@ namespace VEPROMS.CSLA.Library // use the STExtraSpace value (defined for each step type) at the top of page // when that step/sub-step type is the first step part on the page private LazyLoad _DoSTExtraAtTop; - public bool DoSTExtraAtTop - { - get - { - return LazyLoad(ref _DoSTExtraAtTop, "@DoSTExtraAtTop"); - } - } + public bool DoSTExtraAtTop => LazyLoad(ref _DoSTExtraAtTop, "@DoSTExtraAtTop"); - // even if a step will fit on a page by itself, print as much of the step as logically possible on the current page - private LazyLoad _KeepStepsOnPage; - public bool KeepStepsOnPage - { - get - { - return LazyLoad(ref _KeepStepsOnPage, "@KeepStepsOnPage"); - } - } - private LazyLoad _NoOrphans1; - // B2017-154 No Orphans (single sub-step left over from previous page) No Children - // - Don't leave an orphan on the next page if the high level step and first sub-step will fit on the current page - // note: this was put in the V.C.Summ AP1000 plant - public bool NoOrphans1 - { - get - { - return LazyLoad(ref _NoOrphans1, "@NoOrphans1"); - } - } + // even if a step will fit on a page by itself, print as much of the step as logically possible on the current page + private LazyLoad _KeepStepsOnPage; + public bool KeepStepsOnPage => LazyLoad(ref _KeepStepsOnPage, "@KeepStepsOnPage"); + private LazyLoad _NoOrphans1; + // B2017-154 No Orphans (single sub-step left over from previous page) No Children + // - Don't leave an orphan on the next page if the high level step and first sub-step will fit on the current page + // note: this was put in the V.C.Summ AP1000 plant + public bool NoOrphans1 => LazyLoad(ref _NoOrphans1, "@NoOrphans1"); - // the format default setting as to whether each procedure section start on their own page - // The base format has this set to true - each section starts on a new page - private LazyLoad _BreakOnSections; - public bool BreakOnSections - { - get - { - return LazyLoad(ref _BreakOnSections, "@BreakOnSections"); - } - } + // the format default setting as to whether each procedure section start on their own page + // The base format has this set to true - each section starts on a new page + private LazyLoad _BreakOnSections; + public bool BreakOnSections => LazyLoad(ref _BreakOnSections, "@BreakOnSections"); - // will print the section number and title before printing the section text. used only with the PROMS - // step editor sections (not Word sections). section number and title will print only on the first page - // of the section. a check box on the section properties page turns printing of this on/off - private LazyLoad _ShowSectionTitles; - public bool ShowSectionTitles - { - get - { - return LazyLoad(ref _ShowSectionTitles, "@ShowSectionTitles"); - } - } + // will print the section number and title before printing the section text. used only with the PROMS + // step editor sections (not Word sections). section number and title will print only on the first page + // of the section. a check box on the section properties page turns printing of this on/off + private LazyLoad _ShowSectionTitles; + public bool ShowSectionTitles => LazyLoad(ref _ShowSectionTitles, "@ShowSectionTitles"); - // will print the defined section end message for single columns sections. - // the default setting is True - private LazyLoad _EndForSingle; - public bool EndForSingle - { - get - { - return LazyLoad(ref _EndForSingle, "@EndForSingle"); - } - } - // Special pagination case used in some background document formats. This will turn off the KeepStepsOnPage flag when a paragraph off of a High Level step was put on next page (IP2 bck: E-3/References), and a paragraph was writing into the footer (FR-H.1 step 2.2.3.1. KBR 10/14/14) - private LazyLoad _PaginateOnLowerStepLevel; - public bool PaginateOnLowerStepLevel - { - get - { - return LazyLoad(ref _PaginateOnLowerStepLevel, "@PaginateOnLowerStepLevel"); - } - } + // will print the defined section end message for single columns sections. + // the default setting is True + private LazyLoad _EndForSingle; + public bool EndForSingle => LazyLoad(ref _EndForSingle, "@EndForSingle"); + // Special pagination case used in some background document formats. This will turn off the KeepStepsOnPage flag when a paragraph off of a High Level step was put on next page (IP2 bck: E-3/References), and a paragraph was writing into the footer (FR-H.1 step 2.2.3.1. KBR 10/14/14) + private LazyLoad _PaginateOnLowerStepLevel; + public bool PaginateOnLowerStepLevel => LazyLoad(ref _PaginateOnLowerStepLevel, "@PaginateOnLowerStepLevel"); - // B2023-088: alarm format pagination - // Special pagination for Alarm procedures to keep substeps with the high level step - private LazyLoad _AlarmPagination; - public bool AlarmPagination - { - get - { - return LazyLoad(ref _AlarmPagination, "@AlarmPagination"); - } - } + // B2023-088: alarm format pagination + // Special pagination for Alarm procedures to keep substeps with the high level step + private LazyLoad _AlarmPagination; + public bool AlarmPagination => LazyLoad(ref _AlarmPagination, "@AlarmPagination"); - // For McGuire and Catawba, they use CustomSpacing which inserts a blank line before high level steps - // if we paginate on one of these blank lines, we want to skip that blank line so that there isn't an - // extra blank line at the top of the page. - private LazyLoad _CustomSpacing; - public bool CustomSpacing - { - get - { - return LazyLoad(ref _CustomSpacing, "@CustomSpacing"); - } - } + // For McGuire and Catawba, they use CustomSpacing which inserts a blank line before high level steps + // if we paginate on one of these blank lines, we want to skip that blank line so that there isn't an + // extra blank line at the top of the page. + private LazyLoad _CustomSpacing; + public bool CustomSpacing => LazyLoad(ref _CustomSpacing, "@CustomSpacing"); - // when set to False, a caluation for centering text is done with respect to the CPI defined for - // the font to better match the centering of the 16-bit VEPROMS application - private LazyLoad _PicaIgnoreFiveSixths; - public bool PicaIgnoreFiveSixths - { - get - { - return LazyLoad(ref _PicaIgnoreFiveSixths, "@PicaIgnoreFiveSixths"); - } - } + // when set to False, a caluation for centering text is done with respect to the CPI defined for + // the font to better match the centering of the 16-bit VEPROMS application + private LazyLoad _PicaIgnoreFiveSixths; + public bool PicaIgnoreFiveSixths => LazyLoad(ref _PicaIgnoreFiveSixths, "@PicaIgnoreFiveSixths"); - // keep sub-steps together - on a page by themselves - private LazyLoad _PutOnPageByItself; - public bool PutOnPageByItself - { - get - { - return LazyLoad(ref _PutOnPageByItself, "@PutOnPageByItself"); - } - } + // keep sub-steps together - on a page by themselves + private LazyLoad _PutOnPageByItself; + public bool PutOnPageByItself => LazyLoad(ref _PutOnPageByItself, "@PutOnPageByItself"); - // If a high level step, the 16bit code uses the value of the extra space - // from the high level step format regardless of what type of high level step it is: - // Added check for UseSTExtraRealValue, if set, we want to use what is set for the specific step type - private LazyLoad _UseSTExtraRealValue; - public bool UseSTExtraRealValue - { - get - { - return LazyLoad(ref _UseSTExtraRealValue, "@UseSTExtraRealValue"); - } - } + // If a high level step, the 16bit code uses the value of the extra space + // from the high level step format regardless of what type of high level step it is: + // Added check for UseSTExtraRealValue, if set, we want to use what is set for the specific step type + private LazyLoad _UseSTExtraRealValue; + public bool UseSTExtraRealValue => LazyLoad(ref _UseSTExtraRealValue, "@UseSTExtraRealValue"); - // Causes step tabs to be built according to the actual level, with respect to the section level and the step level (i.e. sub-sections count as a level) - private LazyLoad _TieTabToLevel; - public bool TieTabToLevel - { - get - { - return LazyLoad(ref _TieTabToLevel, "@TieTabToLevel"); - } - } + // Causes step tabs to be built according to the actual level, with respect to the section level and the step level (i.e. sub-sections count as a level) + private LazyLoad _TieTabToLevel; + public bool TieTabToLevel => LazyLoad(ref _TieTabToLevel, "@TieTabToLevel"); - // C2026-003 (for Vogtle Units 3&4) Adds the continuous action tag to a high level RNO - // only when it as a tab and the parent is an AER step that is not tagged as a continuous action - // Use this with the setting of CASPrintMacro and CASEditTag on the RNO step type TabData definition - private LazyLoad _AddContActTagToHighLevelRNOWhenIncludedOnCAS; - public bool AddContActTagToHighLevelRNOWhenIncludedOnCAS - { - get - { - return LazyLoad(ref _AddContActTagToHighLevelRNOWhenIncludedOnCAS, "@AddContActTagToHighLevelRNOWhenIncludedOnCAS"); - } - } + // C2026-003 (for Vogtle Units 3&4) Adds the continuous action tag to a high level RNO + // only when it as a tab and the parent is an AER step that is not tagged as a continuous action + // Use this with the setting of CASPrintMacro and CASEditTag on the RNO step type TabData definition + private LazyLoad _AddContActTagToHighLevelRNOWhenIncludedOnCAS; + public bool AddContActTagToHighLevelRNOWhenIncludedOnCAS => LazyLoad(ref _AddContActTagToHighLevelRNOWhenIncludedOnCAS, "@AddContActTagToHighLevelRNOWhenIncludedOnCAS"); - // treat sub-sections and High Level Steps as if they are at the same procedure structure level. This is used with the TieTabToLevel flag - private LazyLoad _SubSectAndHighSameLevel; - public bool SubSectAndHighSameLevel - { - get - { - return LazyLoad(ref _SubSectAndHighSameLevel, "@SubSectAndHighSameLevel"); - } - } + // treat sub-sections and High Level Steps as if they are at the same procedure structure level. This is used with the TieTabToLevel flag + private LazyLoad _SubSectAndHighSameLevel; + public bool SubSectAndHighSameLevel => LazyLoad(ref _SubSectAndHighSameLevel, "@SubSectAndHighSameLevel"); - // compress only part of the step (i.e. a sub-step) so that the entire step can fit on a page - private LazyLoad _PartialStepCompression; + // compress only part of the step (i.e. a sub-step) so that the entire step can fit on a page + private LazyLoad _PartialStepCompression; public bool PartialStepCompression { get @@ -3851,44 +2307,20 @@ namespace VEPROMS.CSLA.Library } // remove the ".0" from a bottom continue message private LazyLoad _VirtualDotInHLSTab; - public bool VirtualDotInHLSTab - { - get - { - return LazyLoad(ref _VirtualDotInHLSTab, "@VirtualDotInHLSTab"); - } - } - // was put in for NSP's Cautions and Notes which are not boxed but formatted differently than other non-boxed Cautions and Notes, allow to specify a starting column and width where the Note/Caution step types are defined - private LazyLoad _NullBox; - public bool NullBox - { - get - { - return LazyLoad(ref _NullBox, "@NullBox"); - } - } + public bool VirtualDotInHLSTab => LazyLoad(ref _VirtualDotInHLSTab, "@VirtualDotInHLSTab"); + // was put in for NSP's Cautions and Notes which are not boxed but formatted differently than other non-boxed Cautions and Notes, allow to specify a starting column and width where the Note/Caution step types are defined + private LazyLoad _NullBox; + public bool NullBox => LazyLoad(ref _NullBox, "@NullBox"); - // turns on the ability to add Notes and Cautions off of a Section title in the PROMS step editor - private LazyLoad _AllowNoteCautionAdd; - public bool AllowNoteCautionAdd - { - get - { - return LazyLoad(ref _AllowNoteCautionAdd, "@AllowNoteCautionAdd"); - } - } + // turns on the ability to add Notes and Cautions off of a Section title in the PROMS step editor + private LazyLoad _AllowNoteCautionAdd; + public bool AllowNoteCautionAdd => LazyLoad(ref _AllowNoteCautionAdd, "@AllowNoteCautionAdd"); - // F2024-037 reset the seq sub-step numbering if the parent is an un-numbered high level step - // F2024-049 changed to specify the level, to change to, via the format file (Generic EOP and Vogtle 3&4) - private LazyLoad _ResetSeqNumberingAfterUnnumberedHLS; - public int? ResetSeqNumberingAfterUnnumberedHLS - { - get - { - return LazyLoad(ref _ResetSeqNumberingAfterUnnumberedHLS, "@ResetSeqNumberingAfterUnnumberedHLS"); - } - } - } + // F2024-037 reset the seq sub-step numbering if the parent is an un-numbered high level step + // F2024-049 changed to specify the level, to change to, via the format file (Generic EOP and Vogtle 3&4) + private LazyLoad _ResetSeqNumberingAfterUnnumberedHLS; + public int? ResetSeqNumberingAfterUnnumberedHLS => LazyLoad(ref _ResetSeqNumberingAfterUnnumberedHLS, "@ResetSeqNumberingAfterUnnumberedHLS"); + } #endregion - StepSectionLayoutData #region Separator public class Separator : vlnFormatItem @@ -3897,25 +2329,12 @@ namespace VEPROMS.CSLA.Library //the placement setting for the separator words used for OR the sub-steps and the Explicit And sub-steps private LazyLoad _Location; - public int? Location - { - get - { - return LazyLoad(ref _Location, "@Location"); - //return LazyLoad(ref _SeparatorLocation, "@SeparatorLocation"); - } - } + public int? Location => LazyLoad(ref _Location, "@Location"); - // the font specifications for the separator text for OR the sub-steps and the Explicit And sub-steps - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null ? _Font = new VE_Font(base.XmlNode) : _Font); - } - } - } + // the font specifications for the separator text for OR the sub-steps and the Explicit And sub-steps + private VE_Font _Font; + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); + } #endregion - Separator #region StepSectionPrintData public class StepSectionPrintData : vlnFormatItem @@ -3929,98 +2348,44 @@ namespace VEPROMS.CSLA.Library // when set to True - will put 1 line between the box line and step text resulting in // no extra line between the box and top/bottom of step. private LazyLoad _DiffContActBox; - public bool DiffContActBox - { - get - { - return LazyLoad(ref _DiffContActBox, "@DiffContActBox"); - } - } - // will allow the drawing of a box round substeps that have a defined box - private LazyLoad _ContActBoxOnSubSteps; - public bool ContActBoxOnSubSteps - { - get - { - return LazyLoad(ref _ContActBoxOnSubSteps, "@ContActBoxOnSubSteps"); - } - } - // this will print the defined string after the last RNO for a step or sub-step - // some plants print a string of a couple spaces to add an extra blank line instead - private LazyLoad _RNOSepString; - public string RNOSepString - { - get - { - return LazyLoad(ref _RNOSepString, "@RNOSepString"); - } - } + public bool DiffContActBox => LazyLoad(ref _DiffContActBox, "@DiffContActBox"); + // will allow the drawing of a box round substeps that have a defined box + private LazyLoad _ContActBoxOnSubSteps; + public bool ContActBoxOnSubSteps => LazyLoad(ref _ContActBoxOnSubSteps, "@ContActBoxOnSubSteps"); + // this will print the defined string after the last RNO for a step or sub-step + // some plants print a string of a couple spaces to add an extra blank line instead + private LazyLoad _RNOSepString; + public string RNOSepString => LazyLoad(ref _RNOSepString, "@RNOSepString"); - // specify the length of the RNO separator. if not set, then code uses length of RNOSepString. if no RNOSepString then the code creates an empty RNO separtor. - private LazyLoad _RNOSepLineLength; - public float? RNOSepLineLength - { - get - { - return LazyLoad(ref _RNOSepLineLength, "@RNOSepLineLength"); - } - } - // will print the defined string between each High Level Step type. Used in the Long Form Deviation format - private LazyLoad _HLStpSeparatorString; - public string HLStpSeparatorString - { - get - { - return LazyLoad(ref _HLStpSeparatorString, "@HLStpSeparatorString"); - } - } + // specify the length of the RNO separator. if not set, then code uses length of RNOSepString. if no RNOSepString then the code creates an empty RNO separtor. + private LazyLoad _RNOSepLineLength; + public float? RNOSepLineLength => LazyLoad(ref _RNOSepLineLength, "@RNOSepLineLength"); + // will print the defined string between each High Level Step type. Used in the Long Form Deviation format + private LazyLoad _HLStpSeparatorString; + public string HLStpSeparatorString => LazyLoad(ref _HLStpSeparatorString, "@HLStpSeparatorString"); - // will print the defined string between each High Level RNO Step type. Used in the Long Form Deviation format - private LazyLoad _HLRNOStpSeparatorString; - public string HLRNOStpSeparatorString - { - get - { - return LazyLoad(ref _HLRNOStpSeparatorString, "@HLRNOStpSeparatorString"); - } - } + // will print the defined string between each High Level RNO Step type. Used in the Long Form Deviation format + private LazyLoad _HLRNOStpSeparatorString; + public string HLRNOStpSeparatorString => LazyLoad(ref _HLRNOStpSeparatorString, "@HLRNOStpSeparatorString"); - // turns on the ability to enter a procedure set revision number (string) on the Working Draft properties page - private LazyLoad _UseXtraRevNumber; - public bool UseXtraRevNumber - { - get - { - return LazyLoad(ref _UseXtraRevNumber, "@UseXtraRevNumber"); - } - } + // turns on the ability to enter a procedure set revision number (string) on the Working Draft properties page + private LazyLoad _UseXtraRevNumber; + public bool UseXtraRevNumber => LazyLoad(ref _UseXtraRevNumber, "@UseXtraRevNumber"); - // Don't all step text to print past right margin. put in for Point Beach's Background document - private LazyLoad _LimitWidToPageWid; - public bool LimitWidToPageWid - { - get - { - return LazyLoad(ref _LimitWidToPageWid, "@LimitWidToPageWid"); - } - } - // add the parent tab to the step or sub-step tab - private LazyLoad _CombinedTabIncludeParenTabs; - public bool CombinedTabIncludeParenTabs - { - get - { - return LazyLoad(ref _CombinedTabIncludeParenTabs, "@CombinedTabIncludeParenTabs"); - } - } + // Don't all step text to print past right margin. put in for Point Beach's Background document + private LazyLoad _LimitWidToPageWid; + public bool LimitWidToPageWid => LazyLoad(ref _LimitWidToPageWid, "@LimitWidToPageWid"); + // add the parent tab to the step or sub-step tab + private LazyLoad _CombinedTabIncludeParenTabs; + public bool CombinedTabIncludeParenTabs => LazyLoad(ref _CombinedTabIncludeParenTabs, "@CombinedTabIncludeParenTabs"); - // a list of hard coded tab placement adjustments per step level - private LeftJustifyList _LeftJustifyList; + // a list of hard coded tab placement adjustments per step level + private LeftJustifyList _LeftJustifyList; public LeftJustifyList LeftJustifyList { get { - return (_LeftJustifyList == null) ? _LeftJustifyList = new LeftJustifyList(SelectNodes("LeftJustifyList/LeftJustify")) : _LeftJustifyList; + return _LeftJustifyList ?? (_LeftJustifyList = new LeftJustifyList(SelectNodes("LeftJustifyList/LeftJustify"))); } set { _LeftJustifyList = value; } } @@ -4040,24 +2405,12 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } // represents the step level in which to use the LeftJustify Size value private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } + public int? Index => LazyLoad(ref _Index, "@Index"); - // the LeftJustify value - private LazyLoad _Size; - public float? Size - { - get - { - return LazyLoad(ref _Size, "@Size"); - } - } - } + // the LeftJustify value + private LazyLoad _Size; + public float? Size => LazyLoad(ref _Size, "@Size"); + } #endregion - LeftJustify #endregion - LeftJustifyList #endregion - StepSectionPrintData @@ -4069,68 +2422,34 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } public SeqTabFmt() : base() { } // index number of each SeqTabFmt item in the SequentialTabFormat list private LazyLoad _Index; - [Description("SeqTab Index")] - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } + [Description("SeqTab Index")] + public int? Index => LazyLoad(ref _Index, "@Index"); - // the token representing the type of tab to use. ex: {numeric} for a number, {alpha} for a letter - private LazyLoad _TabToken; - public string TabToken - { - get - { - return LazyLoad(ref _TabToken, "@TabToken"); - } - } + // the token representing the type of tab to use. ex: {numeric} for a number, {alpha} for a letter + private LazyLoad _TabToken; + public string TabToken => LazyLoad(ref _TabToken, "@TabToken"); - // the formatting definition for that tab (usually uses the "{seq}" token). defines if the tab ends with a period, closed parenthesis, etc. - // this format setting is also used for printing - we currently ignore the format setting for PrintTabFormat - private LazyLoad _TabFormat; - public string TabFormat - { - get - { - return LazyLoad(ref _TabFormat, "@TabFormat"); - } - } + // the formatting definition for that tab (usually uses the "{seq}" token). defines if the tab ends with a period, closed parenthesis, etc. + // this format setting is also used for printing - we currently ignore the format setting for PrintTabFormat + private LazyLoad _TabFormat; + public string TabFormat => LazyLoad(ref _TabFormat, "@TabFormat"); - // the formatting definition for that tab. defines if the tab ends with a period, closed parenthesis, etc. - // - we currently ignore this format setting when printing and use the value of TabFormat instead. - // leaving it this way in case we find a need to have different tab formats for editor and printing - private LazyLoad _PrintTabFormat; - public string PrintTabFormat - { - get - { - return LazyLoad(ref _TabFormat, "@PrintTabFormat"); - } - } + // the formatting definition for that tab. defines if the tab ends with a period, closed parenthesis, etc. + // - we currently ignore this format setting when printing and use the value of TabFormat instead. + // leaving it this way in case we find a need to have different tab formats for editor and printing +#pragma warning disable 169 + private readonly LazyLoad _PrintTabFormat; +#pragma warning disable 169 + public string PrintTabFormat => LazyLoad(ref _TabFormat, "@PrintTabFormat"); - // when the tab is built with parent tab information, don't trim the parent tab (don't remove the surrounding spaces before building the tab - private LazyLoad _DontTrimParentTabBeforeAppending; // B2019-011 for Barakah Alarm format - public bool DontTrimParentTabBeforeAppending - { - get - { - return LazyLoad(ref _DontTrimParentTabBeforeAppending, "@DontTrimParentTabBeforeAppending"); - } - } - public override string GetPDDisplayName() - { return string.Format("Index [{0}]", Index); } - public override string GetPDDescription() - { return string.Format("Sequential Tab Format Index '{0}' Format '{1}'", Index, TabFormat); } - public override string GetPDCategory() - { return "Sequential Tab Formatting"; } - public override string ToString() - { - return TabFormat; - } - } + // when the tab is built with parent tab information, don't trim the parent tab (don't remove the surrounding spaces before building the tab + private LazyLoad _DontTrimParentTabBeforeAppending; // B2019-011 for Barakah Alarm format + public bool DontTrimParentTabBeforeAppending => LazyLoad(ref _DontTrimParentTabBeforeAppending, "@DontTrimParentTabBeforeAppending"); + public override string GetPDDisplayName() => string.Format("Index [{0}]", Index); + public override string GetPDDescription() => string.Format("Sequential Tab Format Index '{0}' Format '{1}'", Index, TabFormat); + public override string GetPDCategory() => "Sequential Tab Formatting"; + public override string ToString() => TabFormat; + } # endregion - SeqTabFmt #region SeqTabFmtList [TypeConverter(typeof(vlnIndexedListConverter))] @@ -4164,7 +2483,7 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } { get { - return (_TableOfContentsData == null ? _TableOfContentsData = new TableOfContentsData(SelectSingleNode("TableOfContentsData")) : _TableOfContentsData); + return (_TableOfContentsData ?? (_TableOfContentsData = new TableOfContentsData(SelectSingleNode("TableOfContentsData")))); } } @@ -4176,7 +2495,7 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } { get { - return (_ContinuousActionSummaryData == null ? _ContinuousActionSummaryData = new ConitnuousActionSummaryData(SelectSingleNode("ConitnuousActionSummaryData")) : _ContinuousActionSummaryData); + return (_ContinuousActionSummaryData ?? (_ContinuousActionSummaryData = new ConitnuousActionSummaryData(SelectSingleNode("ConitnuousActionSummaryData")))); } } } @@ -4189,95 +2508,41 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } // positon of the section number from the left margin private LazyLoad _TofCSecNumPos; - public float? TofCSecNumPos - { - get - { - return LazyLoad(ref _TofCSecNumPos, "@TofCSecNumPos"); - } - } - // position of the section title from the left margin - private LazyLoad _TofCSecTitlePos; - public float? TofCSecTitlePos - { - get - { - return LazyLoad(ref _TofCSecTitlePos, "@TofCSecTitlePos"); - } - } + public float? TofCSecNumPos => LazyLoad(ref _TofCSecNumPos, "@TofCSecNumPos"); + // position of the section title from the left margin + private LazyLoad _TofCSecTitlePos; + public float? TofCSecTitlePos => LazyLoad(ref _TofCSecTitlePos, "@TofCSecTitlePos"); - // length of the section title before wrapping onto the next line - private LazyLoad _TofCSecTitleLen; - public int? TofCSecTitleLen - { - get - { - return LazyLoad(ref _TofCSecTitleLen, "@TofCSecTitleLen"); - } - } + // length of the section title before wrapping onto the next line + private LazyLoad _TofCSecTitleLen; + public int? TofCSecTitleLen => LazyLoad(ref _TofCSecTitleLen, "@TofCSecTitleLen"); - // positon of the the section's starting page number - private LazyLoad _TofCPageNumPos; - public float? TofCPageNumPos - { - get - { - return LazyLoad(ref _TofCPageNumPos, "@TofCPageNumPos"); - } - } + // positon of the the section's starting page number + private LazyLoad _TofCPageNumPos; + public float? TofCPageNumPos => LazyLoad(ref _TofCPageNumPos, "@TofCPageNumPos"); - // the character used for the spaces between the section title and the page number - i.e. leader dots - private LazyLoad _TofCSpaceChar; - public string TofCSpaceChar - { - get - { - return LazyLoad(ref _TofCSpaceChar, "@TofCSpaceChar"); - } - } + // the character used for the spaces between the section title and the page number - i.e. leader dots + private LazyLoad _TofCSpaceChar; + public string TofCSpaceChar => LazyLoad(ref _TofCSpaceChar, "@TofCSpaceChar"); - // the line spaces between each item on the table of contents - private LazyLoad _TofCLineSpacing; - public float? TofCLineSpacing - { - get - { - return LazyLoad(ref _TofCLineSpacing, "@TofCLineSpacing"); - } - } + // the line spaces between each item on the table of contents + private LazyLoad _TofCLineSpacing; + public float? TofCLineSpacing => LazyLoad(ref _TofCLineSpacing, "@TofCLineSpacing"); - // specify how many section / sub-sections to include on the TOC page - private LazyLoad _TofCNumLevels; - public int? TofCNumLevels - { - get - { - return LazyLoad(ref _TofCNumLevels, "@TofCNumLevels"); - } - } + // specify how many section / sub-sections to include on the TOC page + private LazyLoad _TofCNumLevels; + public int? TofCNumLevels => LazyLoad(ref _TofCNumLevels, "@TofCNumLevels"); - // specify after which section level to start indenting the entries on the TOC page - private LazyLoad _TofCStartIndentAfterLevel; - public int? TofCStartIndentAfterLevel - { - get - { - return LazyLoad(ref _TofCStartIndentAfterLevel, "@TofCStartIndentAfterLevel"); - } - } + // specify after which section level to start indenting the entries on the TOC page + private LazyLoad _TofCStartIndentAfterLevel; + public int? TofCStartIndentAfterLevel => LazyLoad(ref _TofCStartIndentAfterLevel, "@TofCStartIndentAfterLevel"); - // flag to underline the first level section titles - private LazyLoad _TofCUnderlineFirstLevelTitle; - public bool TofCUnderlineFirstLevelTitle - { - get - { - return LazyLoad(ref _TofCUnderlineFirstLevelTitle, "@TofCUnderlineFirstLevelTitle"); - } - } + // flag to underline the first level section titles + private LazyLoad _TofCUnderlineFirstLevelTitle; + public bool TofCUnderlineFirstLevelTitle => LazyLoad(ref _TofCUnderlineFirstLevelTitle, "@TofCUnderlineFirstLevelTitle"); - // specify the page number alignment with respect to the page number position - default is left justify - private LazyLoad _TofCPageNumAlign; + // specify the page number alignment with respect to the page number position - default is left justify + private LazyLoad _TofCPageNumAlign; public string TofCPageNumAlign { get @@ -4300,43 +2565,19 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } // specify the line spacing to be just for the sub-sections entries private LazyLoad _TofCLineSpacingSub; - public int? TofCLineSpacingSub - { - get - { - return LazyLoad(ref _TofCLineSpacingSub, "@TofCLineSpacingSub"); - } - } - // if the Group Heading (defined in section's properties automation tab) is also part of the section number, - // remove it the Group Heading text from the section number - VEGP1, VEGP2 - private LazyLoad _TofCRemoveGrpNameInSects; - public bool TofCRemoveGrpNameInSects - { - get - { - return LazyLoad(ref _TofCRemoveGrpNameInSects, "@TofCRemoveGrpNameInSects"); - } - } + public int? TofCLineSpacingSub => LazyLoad(ref _TofCLineSpacingSub, "@TofCLineSpacingSub"); + // if the Group Heading (defined in section's properties automation tab) is also part of the section number, + // remove it the Group Heading text from the section number - VEGP1, VEGP2 + private LazyLoad _TofCRemoveGrpNameInSects; + public bool TofCRemoveGrpNameInSects => LazyLoad(ref _TofCRemoveGrpNameInSects, "@TofCRemoveGrpNameInSects"); - // C2021-015: Barakah High Level Steps in Table of Contents - // if set in the Step Properties pannel - private LazyLoad _TofCAllowHLS; - public bool TofCAllowHLS - { - get - { - return LazyLoad(ref _TofCAllowHLS, "@TofCAllowHLS"); - } - } - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null) ? _Font = new VE_Font(base.XmlNode) : _Font; - } - } - } + // C2021-015: Barakah High Level Steps in Table of Contents + // if set in the Step Properties pannel + private LazyLoad _TofCAllowHLS; + public bool TofCAllowHLS => LazyLoad(ref _TofCAllowHLS, "@TofCAllowHLS"); + private VE_Font _Font; + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); + } #endregion - TableOfContentsData #region ConitnuousActionSummary @@ -4346,43 +2587,19 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } // include the section number and title for the sections that contains continuous action steps private LazyLoad _IncludeSectionNumAndTitle; - public bool IncludeSectionNumAndTitle - { - get - { - return LazyLoad(ref _IncludeSectionNumAndTitle, "@IncludeSectionNumAndTitle"); - } - } + public bool IncludeSectionNumAndTitle => LazyLoad(ref _IncludeSectionNumAndTitle, "@IncludeSectionNumAndTitle"); - //F2025-038 default (in base format) is True. The lable "SECTION" will precede the section number an title - private LazyLoad _IncludeSectionLabel; - public bool IncludeSectionLabel - { - get - { - return LazyLoad(ref _IncludeSectionLabel, "@IncludeSectionLabel"); - } - } - //F2026-001 default (in base format) is False. Put in for Vogtle Units 3 & 4. - // this will add the parent sub-step tab if the parent is not identified as a continueous action step - private LazyLoad _AddParentTabToSubStepTab; - public bool AddParentTabToSubStepTab - { - get - { - return LazyLoad(ref _AddParentTabToSubStepTab, "@AddParentTabToSubStepTab"); - } - } - // the font and font styles to use for the continuous action summary - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null) ? _Font = new VE_Font(base.XmlNode) : _Font; - } - } - } + //F2025-038 default (in base format) is True. The lable "SECTION" will precede the section number an title + private LazyLoad _IncludeSectionLabel; + public bool IncludeSectionLabel => LazyLoad(ref _IncludeSectionLabel, "@IncludeSectionLabel"); + //F2026-001 default (in base format) is False. Put in for Vogtle Units 3 & 4. + // this will add the parent sub-step tab if the parent is not identified as a continueous action step + private LazyLoad _AddParentTabToSubStepTab; + public bool AddParentTabToSubStepTab => LazyLoad(ref _AddParentTabToSubStepTab, "@AddParentTabToSubStepTab"); + // the font and font styles to use for the continuous action summary + private VE_Font _Font; + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); + } #endregion - ConitnuousActionSummary #endregion - AccSectionDataAll @@ -4396,60 +2613,25 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } // represents the section level private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - // the column adjustment (indent) inwhich to print the section number for that level of section (sub-section) - private LazyLoad _SecNumPositionAdj; - public float? SecNumPositionAdj - { - get - { - return LazyLoad(ref _SecNumPositionAdj, "@SecNumPositionAdj"); - } - } + public int? Index => LazyLoad(ref _Index, "@Index"); + // the column adjustment (indent) inwhich to print the section number for that level of section (sub-section) + private LazyLoad _SecNumPositionAdj; + public float? SecNumPositionAdj => LazyLoad(ref _SecNumPositionAdj, "@SecNumPositionAdj"); - // the column adjustment (indent) inwhich to print the section title for that level of section (sub-section) - private LazyLoad _SecTitlePositionAdj; - public float? SecTitlePositionAdj - { - get - { - return LazyLoad(ref _SecTitlePositionAdj, "@SecTitlePositionAdj"); - } - } - // adjustment (indent) for the high level steps for that level of section (sub-section) - private LazyLoad _ColSByLevel; - public float? ColSByLevel - { - get - { - return LazyLoad(ref _ColSByLevel, "@ColSByLevel"); - } - } + // the column adjustment (indent) inwhich to print the section title for that level of section (sub-section) + private LazyLoad _SecTitlePositionAdj; + public float? SecTitlePositionAdj => LazyLoad(ref _SecTitlePositionAdj, "@SecTitlePositionAdj"); + // adjustment (indent) for the high level steps for that level of section (sub-section) + private LazyLoad _ColSByLevel; + public float? ColSByLevel => LazyLoad(ref _ColSByLevel, "@ColSByLevel"); - // adjustment for the width of the high level steps for that level of section (sub-section) - private LazyLoad _WidSAdjByLevel; - public float? WidSAdjByLevel - { - get - { - return LazyLoad(ref _WidSAdjByLevel, "@WidSAdjByLevel"); - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}]", Index); } - public override string GetPDCategory() - { return "Meta Section Values"; } - public override string ToString() - { - return String.Format("{0}, {1}, {2}, {3}", SecNumPositionAdj, SecTitlePositionAdj, ColSByLevel, WidSAdjByLevel); - } - } + // adjustment for the width of the high level steps for that level of section (sub-section) + private LazyLoad _WidSAdjByLevel; + public float? WidSAdjByLevel => LazyLoad(ref _WidSAdjByLevel, "@WidSAdjByLevel"); + public override string GetPDDisplayName() => string.Format("[{0}]", Index); + public override string GetPDCategory() => "Meta Section Values"; + public override string ToString() => String.Format("{0}, {1}, {2}, {3}", SecNumPositionAdj, SecTitlePositionAdj, ColSByLevel, WidSAdjByLevel); + } #endregion - MetaSection @@ -4482,150 +2664,64 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } // translated to a step type number - this number is used to allow the BASE format settting in the Plant formats private LazyLoad _Index; - [Description("Step Index")] - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } + [Description("Step Index")] + public int? Index => LazyLoad(ref _Index, "@Index"); - // text description of the step part type (ex. High, Caution, Note) - private LazyLoad _Type; - public string Type - { - get - { - return LazyLoad(ref _Type, "@Type"); - } - } - // the step type from which settings are inherited - private LazyLoad _ParentType; - public string ParentType - { - get - { - return LazyLoad(ref _ParentType, "@ParentType"); - } - } - // user cannot directly edit the text in step type - usually auto generated text like TITLEWITHTEXTBELOW used in background documents - private LazyLoad _ReadOnly; - public bool ReadOnly - { - get - { - return LazyLoad(ref _ReadOnly, "@ReadOnly"); - } - } + // text description of the step part type (ex. High, Caution, Note) + private LazyLoad _Type; + public string Type => LazyLoad(ref _Type, "@Type"); + // the step type from which settings are inherited + private LazyLoad _ParentType; + public string ParentType => LazyLoad(ref _ParentType, "@ParentType"); + // user cannot directly edit the text in step type - usually auto generated text like TITLEWITHTEXTBELOW used in background documents + private LazyLoad _ReadOnly; + public bool ReadOnly => LazyLoad(ref _ReadOnly, "@ReadOnly"); - // Less space between text and bottom line of Caution Box - private LazyLoad _NoYBxAdjust; // F2021-038: SHE/SHEA less space after top line & before bottom line - public bool NoYBxAdjust - { - get - { - return LazyLoad(ref _NoYBxAdjust, "@NoYBxAdjust"); - } - } - //private LazyLoad _SeparateWarning; // KBR: To be used for Proms Express to separate out warnings from notes/cautions on ribbon, etc - NO CODE TO SUPPORT THIS YET AND IS NOT SET IN PROMS EXPRESS FORMATS - //public bool SeparateWarning - //{ - // get - // { - // return LazyLoad(ref _SeparateWarning, "@SeparateWarning"); - // } - //} + // Less space between text and bottom line of Caution Box + private LazyLoad _NoYBxAdjust; // F2021-038: SHE/SHEA less space after top line & before bottom line + public bool NoYBxAdjust => LazyLoad(ref _NoYBxAdjust, "@NoYBxAdjust"); - // when set to Truen the step type will not appear in the insert step or sub-step lists. used to turn off (remove) the availability of step types that are not used or needed by the customer - private LazyLoad _Inactive; - public bool Inactive - { - get - { - return LazyLoad(ref _Inactive, "@Inactive"); - } - } + // when set to Truen the step type will not appear in the insert step or sub-step lists. used to turn off (remove) the availability of step types that are not used or needed by the customer + private LazyLoad _Inactive; + public bool Inactive => LazyLoad(ref _Inactive, "@Inactive"); - // F2018-022 Added step type flag to append a ".0" to the end of the high level step - // - put in for Westinghouse single column format (wst1) - // - used when a high level step is used as a section number and title - private LazyLoad _AppendDotZero; - public bool AppendDotZero - { - get - { - return LazyLoad(ref _AppendDotZero, "@AppendDotZero"); - } - } - // F2019-069: Barakah Hold Point - set xoffset to parent's tab - // put in for BNPP (Barakah). the Hold Point (note type) needed indented the same as the high level step - // that it apples to, instead of centering it on the page like a normal Note type - private LazyLoad _ColUseParentTab; - public bool ColUseParentTab - { - get - { - return LazyLoad(ref _ColUseParentTab, "@ColUseParentTab"); - } - } + // F2018-022 Added step type flag to append a ".0" to the end of the high level step + // - put in for Westinghouse single column format (wst1) + // - used when a high level step is used as a section number and title + private LazyLoad _AppendDotZero; + public bool AppendDotZero => LazyLoad(ref _AppendDotZero, "@AppendDotZero"); + // F2019-069: Barakah Hold Point - set xoffset to parent's tab + // put in for BNPP (Barakah). the Hold Point (note type) needed indented the same as the high level step + // that it apples to, instead of centering it on the page like a normal Note type + private LazyLoad _ColUseParentTab; + public bool ColUseParentTab => LazyLoad(ref _ColUseParentTab, "@ColUseParentTab"); - // this will override the ColS format setting for the specific step type - private LazyLoad _ColOverride; - public float? ColOverride - { - get - { - return LazyLoad(ref _ColOverride, "@ColOverride"); - } - } + // this will override the ColS format setting for the specific step type + private LazyLoad _ColOverride; + public float? ColOverride => LazyLoad(ref _ColOverride, "@ColOverride"); - // this will override the WidS format setting for the specific step type - private LazyLoad _WidthOverride; - public string WidthOverride - { - get - { - return LazyLoad(ref _WidthOverride, "@WidthOverride"); - } - } + // this will override the WidS format setting for the specific step type + private LazyLoad _WidthOverride; + public string WidthOverride => LazyLoad(ref _WidthOverride, "@WidthOverride"); - // Separtor text that is printed beween consecutive step items of this type - // ex: "-OR-" may be printed between two consecutive OR sub-step types - private LazyLoad _Sep; - public string Sep - { - get - { - return LazyLoad(ref _Sep, "@Sep"); - } - } + // Separtor text that is printed beween consecutive step items of this type + // ex: "-OR-" may be printed between two consecutive OR sub-step types + private LazyLoad _Sep; + public string Sep => LazyLoad(ref _Sep, "@Sep"); - // a text string that is placed before the text of this step type. - // Used in the Checklist formats to draw lines (for a table) when printed. - // Also used to add a step text designator character before step text - private LazyLoad _Prefix; - public string Prefix - { - get - { - return LazyLoad(ref _Prefix, "@Prefix"); - } - } - // a text string that is placed after the text of this step type. Used in the Checklist formats to draw lines (for a table) when printed. - private LazyLoad _Suffix; - public string Suffix - { - get - { - return LazyLoad(ref _Suffix, "@Suffix"); - } - } + // a text string that is placed before the text of this step type. + // Used in the Checklist formats to draw lines (for a table) when printed. + // Also used to add a step text designator character before step text + private LazyLoad _Prefix; + public string Prefix => LazyLoad(ref _Prefix, "@Prefix"); + // a text string that is placed after the text of this step type. Used in the Checklist formats to draw lines (for a table) when printed. + private LazyLoad _Suffix; + public string Suffix => LazyLoad(ref _Suffix, "@Suffix"); - // F2019-069: Barakah Hold Point - allow for default text (for Barakah it is 'Hold Point') - //whenever this step type is added to a step, - //this text field will automatically be populated with this text - private LazyLoad _DefaultText; + // F2019-069: Barakah Hold Point - allow for default text (for Barakah it is 'Hold Point') + //whenever this step type is added to a step, + //this text field will automatically be populated with this text + private LazyLoad _DefaultText; public string DefaultText { get @@ -5089,7 +3185,7 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } { get { - if (PlantFormat.IgnoreUCF) return (_Font == null) ? _Font = new VE_Font(base.XmlNode) : _Font; + if (PlantFormat.IgnoreUCF) return _Font ?? (_Font = new VE_Font(XmlNode)); if (_Font != null) return (_Font); VE_Font vef = GetUCFFontAsVE_Font(); if (vef != null) @@ -5097,7 +3193,7 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } _Font = vef; return vef; } - return (_Font == null) ? _Font = new VE_Font(base.XmlNode) : _Font; + return _Font ?? (_Font = new VE_Font(XmlNode)); } } private StepLayoutData _StepLayoutData; @@ -5105,7 +3201,7 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } { get { - return (_StepLayoutData == null) ? _StepLayoutData = new StepLayoutData(base.XmlNode) : _StepLayoutData; + return _StepLayoutData ?? (_StepLayoutData = new StepLayoutData(XmlNode)); } } private StepEditData _StepEditData; @@ -5113,7 +3209,7 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } { get { - return (_StepEditData == null) ? _StepEditData = new StepEditData(base.XmlNode) : _StepEditData; + return _StepEditData ?? (_StepEditData = new StepEditData(XmlNode)); } } private StepPrintData _StepPrintData; @@ -5121,7 +3217,7 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } { get { - return (_StepPrintData == null) ? _StepPrintData = new StepPrintData(base.XmlNode) : _StepPrintData; + return _StepPrintData ?? (_StepPrintData = new StepPrintData(XmlNode)); } } private TabData _TabData; @@ -5129,7 +3225,7 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } { get { - return (_TabData == null) ? _TabData = new TabData(base.XmlNode) : _TabData; + return _TabData ?? (_TabData = new TabData(XmlNode)); } } public override string ToString() @@ -5166,15 +3262,6 @@ public LeftJustifyList(XmlNodeList xmlNodeList) : base(xmlNodeList) { } [TypeConverter(typeof(vlnIndexedListConverter))] public class StepDataList : vlnIndexedFormatList { -//public new StepData this[int index] -//{ -// get -// { -// foreach (StepData stepData in this) -// if (stepData.Index == index) return stepData; -// return null; -// } -//} public override vlnIndexedFormatList InheritedList { get @@ -5197,19 +3284,6 @@ public StepData this[string type] return null; } } -// the following was commented out because it uses the vlnFormat version of the code that indexes the list. -//public StepData this[int index] -//{ -// get -// { -// foreach (StepData stepData in this) -// if (stepData.Index == index) return stepData; -// StepDataList ttlParent = (StepDataList)InheritedList; //Check Inherited Value -// if (ttlParent != null) -// return ttlParent[index]; -// return null; -// } -//} public StepDataList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat) : base(xmlNodeList, myFormat) { } private StepData _HLS; public StepData HLS @@ -5330,32 +3404,6 @@ public StepData Substep return null; } } -// EmbeddedObject has been commented out, 'Equations' are separate top level items. -// This code was left here in case Equations , and other OLE objects, end up -// under the EmbeddedObject: - -// EmbeddedObject has inheritted types that represent OLE objects. -// The first of these is 'Equation'. Another that may be implemented later is Image. -// This is a special case, since only 'Equation' exists on initial development of -// embedded objects, 'skip' the embedded object layer when creating the list and -// go right to the equations. -//private StepData _EmbeddedObject; -//public StepData EmbeddedObject -//{ -// get -// { -// if (_EmbeddedObject != null) return _EmbeddedObject; -// foreach (StepData sd in this) -// { -// if (sd.Type == "EmbeddedObject") -// { -// _Equation = sd; -// return sd; -// } -// } -// return null; -// } -//} private StepData _Equation; public StepData Equation // equation has a parent of embedded object. { @@ -5404,45 +3452,21 @@ public StepData Equation // equation has a parent of embedded object. // add extra spacing before this step type private LazyLoad _STExtraSpace; - public int? STExtraSpace - { - get - { - return LazyLoad(ref _STExtraSpace, "StepLayoutData/@STExtraSpace"); - } - } + public int? STExtraSpace => LazyLoad(ref _STExtraSpace, "StepLayoutData/@STExtraSpace"); - // the number referencing the definition of a box around that step type - used for Caution and Note boxes - private LazyLoad _STBoxindex; - public int? STBoxindex - { - get - { - return LazyLoad(ref _STBoxindex, "StepLayoutData/@STBoxindex"); - } - } + // the number referencing the definition of a box around that step type - used for Caution and Note boxes + private LazyLoad _STBoxindex; + public int? STBoxindex => LazyLoad(ref _STBoxindex, "StepLayoutData/@STBoxindex"); - // will add a blank line after every N number of items - private LazyLoad _EveryNLines; - public int? EveryNLines - { - get - { - return LazyLoad(ref _EveryNLines, "StepLayoutData/@EveryNLines"); - } - } + // will add a blank line after every N number of items + private LazyLoad _EveryNLines; + public int? EveryNLines => LazyLoad(ref _EveryNLines, "StepLayoutData/@EveryNLines"); - // position the step item to start in the same column as it's parent - private LazyLoad _AlignWithParentTab; - public bool AlignWithParentTab - { - get - { - return LazyLoad(ref _AlignWithParentTab, "StepLayoutData/@AlignWithParentTab"); - } - } + // position the step item to start in the same column as it's parent + private LazyLoad _AlignWithParentTab; + public bool AlignWithParentTab => LazyLoad(ref _AlignWithParentTab, "StepLayoutData/@AlignWithParentTab"); - } + } #endregion #region StepEditData [TypeConverter(typeof(ExpandableObjectConverter))] @@ -5453,33 +3477,15 @@ public StepData Equation // equation has a parent of embedded object. { } private TypeMenu _TypeMenu; - public TypeMenu TypeMenu - { - get - { - return (_TypeMenu == null) ? _TypeMenu = new TypeMenu(base.XmlNode) : _TypeMenu; - } - } + public TypeMenu TypeMenu => _TypeMenu ?? (_TypeMenu = new TypeMenu(XmlNode)); - // list of actions defining what can be added to this step type (ex. addingNext, addingPrev, addingNote, addingCaution, addingTable) - private LazyLoad _AcTable; - public E_AccStep? AcTable - { - get - { - return LazyLoad(ref _AcTable, "StepEditData/@AcTable"); - } - } - // specify if this step type can be selected in the PROMS Search module - private LazyLoad _Searchable; - public bool Searchable - { - get - { - return LazyLoad(ref _Searchable, "StepEditData/@Searchable"); - } - } - } + // list of actions defining what can be added to this step type (ex. addingNext, addingPrev, addingNote, addingCaution, addingTable) + private LazyLoad _AcTable; + public E_AccStep? AcTable => LazyLoad(ref _AcTable, "StepEditData/@AcTable"); + // specify if this step type can be selected in the PROMS Search module + private LazyLoad _Searchable; + public bool Searchable => LazyLoad(ref _Searchable, "StepEditData/@Searchable"); + } #endregion #region StepPrintData @@ -5492,42 +3498,19 @@ public StepData Equation // equation has a parent of embedded object. } // allows a Horizontal adjustment (the tab and the text) of the step type when printed private LazyLoad _PosAdjust; - public float? PosAdjust - { - get - { - return LazyLoad(ref _PosAdjust, "StepPrintData/@PosAdjust"); - } - } + public float? PosAdjust => LazyLoad(ref _PosAdjust, "StepPrintData/@PosAdjust"); - // when printing, if this HLS uses a smart template (checklist formats) this value is used to determine when to split across 2 lines - private LazyLoad _HLSLength; - public int? HLSLength - { - get - { - return LazyLoad(ref _HLSLength, "StepPrintData/@HLSLength"); - } - } - // used to set the text justification when it is something other than Left Justified - private LazyLoad _Justify; - public string Justify - { - get - { - return LazyLoad(ref _Justify, "StepPrintData/@Justify"); - } - } - // B2022-003: BNPP Alarms (BNPPalr) - This will add a blank line after the sub of the sub-step - private LazyLoad _BlankAfterSubWithSub; - public bool BlankAfterSubWithSub // B2022-003: BNPP Alarms (BNPPalr) - incorrect line spacing for substeps off substeps. - { - get - { - return LazyLoad(ref _BlankAfterSubWithSub, "StepPrintData/@BlankAfterSubWithSub"); - } - } - } + // when printing, if this HLS uses a smart template (checklist formats) this value is used to determine when to split across 2 lines + private LazyLoad _HLSLength; + public int? HLSLength => LazyLoad(ref _HLSLength, "StepPrintData/@HLSLength"); + // used to set the text justification when it is something other than Left Justified + private LazyLoad _Justify; + public string Justify => LazyLoad(ref _Justify, "StepPrintData/@Justify"); + // B2022-003: BNPP Alarms (BNPPalr) - This will add a blank line after the sub of the sub-step + private LazyLoad _BlankAfterSubWithSub; + public bool BlankAfterSubWithSub // B2022-003: BNPP Alarms (BNPPalr) - incorrect line spacing for substeps off substeps. +=> LazyLoad(ref _BlankAfterSubWithSub, "StepPrintData/@BlankAfterSubWithSub"); + } #endregion #region TypeMenu @@ -5540,62 +3523,26 @@ public StepData Equation // equation has a parent of embedded object. } // This controls whether or not a step or sub-step type appears in the Insert and Search options for the user to select private LazyLoad _InMenu; - public bool InMenu - { - get - { - return LazyLoad(ref _InMenu, "StepEditData/TypeMenu/@InMenu"); - } - } - // RNOs are a specal case. This controls whether or not a RNO type appears in the Insert and Search options for the user to select - private LazyLoad _RnoInMenu; - public bool RnoInMenu - { - get - { - return LazyLoad(ref _RnoInMenu, "StepEditData/TypeMenu/@RnoInMenu"); - } - } + public bool InMenu => LazyLoad(ref _InMenu, "StepEditData/TypeMenu/@InMenu"); + // RNOs are a specal case. This controls whether or not a RNO type appears in the Insert and Search options for the user to select + private LazyLoad _RnoInMenu; + public bool RnoInMenu => LazyLoad(ref _RnoInMenu, "StepEditData/TypeMenu/@RnoInMenu"); - // The name of the step/sub-step type that appears in step/substep menus and lists. - // This allows us to override the default name - private LazyLoad _MenuItem; - public string MenuItem - { - get - { - return LazyLoad(ref _MenuItem, "StepEditData/TypeMenu/@MenuItem"); - } - } + // The name of the step/sub-step type that appears in step/substep menus and lists. + // This allows us to override the default name + private LazyLoad _MenuItem; + public string MenuItem => LazyLoad(ref _MenuItem, "StepEditData/TypeMenu/@MenuItem"); - // used to define an alternative menu name for when the sub-step type is used in an RNO (right column) - private LazyLoad _RnoMenuItem; - public string RnoMenuItem - { - get - { - return LazyLoad(ref _RnoMenuItem, "StepEditData/TypeMenu/@RnoMenuItem"); - } - } - // text to appear for the reason why a step/sub-step type cannot be changed - private LazyLoad _NoChgReason; - public string NoChgReason - { - get - { - return LazyLoad(ref _NoChgReason, "StepEditData/TypeMenu/@NoChgReason"); - } - } - // use with the Caution and Note sub-step types - specifes which other Cautions and Note types the current Caution or Note could be changed to via Step Properties - private LazyLoad _AlternateNameList; - public string AlternateNameList - { - get - { - return LazyLoad(ref _AlternateNameList, "StepEditData/TypeMenu/@AlternateNameList"); - } - } - } + // used to define an alternative menu name for when the sub-step type is used in an RNO (right column) + private LazyLoad _RnoMenuItem; + public string RnoMenuItem => LazyLoad(ref _RnoMenuItem, "StepEditData/TypeMenu/@RnoMenuItem"); + // text to appear for the reason why a step/sub-step type cannot be changed + private LazyLoad _NoChgReason; + public string NoChgReason => LazyLoad(ref _NoChgReason, "StepEditData/TypeMenu/@NoChgReason"); + // use with the Caution and Note sub-step types - specifes which other Cautions and Note types the current Caution or Note could be changed to via Step Properties + private LazyLoad _AlternateNameList; + public string AlternateNameList => LazyLoad(ref _AlternateNameList, "StepEditData/TypeMenu/@AlternateNameList"); + } #endregion #region Bullet [TypeConverter(typeof(ExpandableObjectConverter))] @@ -5607,22 +3554,16 @@ public StepData Equation // equation has a parent of embedded object. // - When using a bullet for multiple Cautions/Notes, use the font size of the Caution/Note text instead of the tab. // all the formats that use this specify the font and font size the the Font setting (below) private LazyLoad _Separate; - public bool Separate - { - get - { - return LazyLoad(ref _Separate, "TabData/Bullet/@Separate"); - } - } - // defines a font to use for the bullet character - private VE_Font _Font; + public bool Separate => LazyLoad(ref _Separate, "TabData/Bullet/@Separate"); + // defines a font to use for the bullet character + private VE_Font _Font; public VE_Font Font { get { if (_Font == null) { - XmlNode xn = vlnFormatDocument.LookupSingleStepNode(base.XmlNode, "Bullet[Font]"); + XmlNode xn = vlnFormatDocument.LookupSingleStepNode(XmlNode, "Bullet[Font]"); _Font = new VE_Font(xn); } return _Font; @@ -5642,219 +3583,99 @@ public StepData Equation // equation has a parent of embedded object. // list of one or more print macros to print with the step tab (used for a checkoff or inital line next to step number) private MacroList _MacroList; - public MacroList MacroList - { - get - { - return _MacroList == null ? _MacroList = new MacroList(SelectNodes("TabData/MacroList/Macro")) : _MacroList; - } - } + public MacroList MacroList => _MacroList ?? (_MacroList = new MacroList(SelectNodes("TabData/MacroList/Macro"))); - // Used to define a designator character to appear in the Step Editor for when the printed character is a macro - // F2022-024 used with the Time Critial Step type (used in Robinson EOP/AOP format) - // this will put the character asigned in the Time Critial Step format defination next to the step tab on the edit screen - // When this step is printed, a macro named Clock (genmac format file) is used instead to print a clock symbol - private LazyLoad _MacroEditTag; - public string MacroEditTag - { - get - { - return LazyLoad(ref _MacroEditTag, "TabData/@MacroEditTag"); - } - } + // Used to define a designator character to appear in the Step Editor for when the printed character is a macro + // F2022-024 used with the Time Critial Step type (used in Robinson EOP/AOP format) + // this will put the character asigned in the Time Critial Step format defination next to the step tab on the edit screen + // When this step is printed, a macro named Clock (genmac format file) is used instead to print a clock symbol + private LazyLoad _MacroEditTag; + public string MacroEditTag => LazyLoad(ref _MacroEditTag, "TabData/@MacroEditTag"); - // defines the formatting of the step tab on the edit screen - private LazyLoad _IdentEdit; - public string IdentEdit - { - get - { - return LazyLoad(ref _IdentEdit, "TabData/@IdentEdit"); - } - } - // defines the formatting of the step tab when printed - private LazyLoad _IdentPrint; - public string IdentPrint - { - get - { - return LazyLoad(ref _IdentPrint, "TabData/@Ident"); - } - } + // defines the formatting of the step tab on the edit screen + private LazyLoad _IdentEdit; + public string IdentEdit => LazyLoad(ref _IdentEdit, "TabData/@IdentEdit"); + // defines the formatting of the step tab when printed + private LazyLoad _IdentPrint; + public string IdentPrint => LazyLoad(ref _IdentPrint, "TabData/@Ident"); - // used in background document formats - allows us to put the step number on one line, then the step text on the next line and it allows us to define prefix text used before each. - private LazyLoad _IdentAltPrint; - public string IdentAltPrint - { - get - { - return LazyLoad(ref _IdentAltPrint, "TabData/@IdentAltPrint"); - } - } + // used in background document formats - allows us to put the step number on one line, then the step text on the next line and it allows us to define prefix text used before each. + private LazyLoad _IdentAltPrint; + public string IdentAltPrint => LazyLoad(ref _IdentAltPrint, "TabData/@IdentAltPrint"); - // defines a step type's corresponding RNO tab seen in the PROMS Step Editor - private LazyLoad _RNOIdentEdit; - public string RNOIdentEdit - { - get - { - return LazyLoad(ref _RNOIdentEdit, "TabData/@RNOIdentEdit"); - } - } + // defines a step type's corresponding RNO tab seen in the PROMS Step Editor + private LazyLoad _RNOIdentEdit; + public string RNOIdentEdit => LazyLoad(ref _RNOIdentEdit, "TabData/@RNOIdentEdit"); - // defines a step type's corresponding RNO tab for the printed output - private LazyLoad _RNOIdent; - public string RNOIdent - { - get - { - return LazyLoad(ref _RNOIdent, "TabData/@RNOIdent"); - } - } - // this uses the same format item as RNOIdent - private LazyLoad _RNOIdentPrint; - public string RNOIdentPrint - { - get - { - return LazyLoad(ref _RNOIdentPrint, "TabData/@RNOIdent"); - } - } - // Adds a print macro for the high level RNO when the user want it to be a Continuous Action - // while the corresponding AER is not a continuous action - // C2026-003 used in RNO step definition for Vogtle 3&4 two column format - // use with AddContActTagToHighLevelRNOWhenIncludedOnCAS set to True in the format file's StpSectLayData - private LazyLoad _CASPrintMacro; - public string CASPrintMacro - { - get - { - return LazyLoad(ref _CASPrintMacro, "TabData/@CASPrintMacro"); - } - } - // Adds a character indicator in the step editor for the high level RNO when the user want it to be a Continuous Action - // while the corresponding AER is not a continuous action - // C2026-003 used in RNO step definition for Vogtle 3&4 two colmn format - // use with AddContActTagToHighLevelRNOWhenIncludedOnCAS set to True in the format file's StpSectLayData - private LazyLoad _CASEditTag; - public string CASEditTag - { - get - { - return LazyLoad(ref _CASEditTag, "TabData/@CASEditTag"); - } - } + // defines a step type's corresponding RNO tab for the printed output + private LazyLoad _RNOIdent; + public string RNOIdent => LazyLoad(ref _RNOIdent, "TabData/@RNOIdent"); + // this uses the same format item as RNOIdent + private LazyLoad _RNOIdentPrint; + public string RNOIdentPrint => LazyLoad(ref _RNOIdentPrint, "TabData/@RNOIdent"); + // Adds a print macro for the high level RNO when the user want it to be a Continuous Action + // while the corresponding AER is not a continuous action + // C2026-003 used in RNO step definition for Vogtle 3&4 two column format + // use with AddContActTagToHighLevelRNOWhenIncludedOnCAS set to True in the format file's StpSectLayData + private LazyLoad _CASPrintMacro; + public string CASPrintMacro => LazyLoad(ref _CASPrintMacro, "TabData/@CASPrintMacro"); + // Adds a character indicator in the step editor for the high level RNO when the user want it to be a Continuous Action + // while the corresponding AER is not a continuous action + // C2026-003 used in RNO step definition for Vogtle 3&4 two colmn format + // use with AddContActTagToHighLevelRNOWhenIncludedOnCAS set to True in the format file's StpSectLayData + private LazyLoad _CASEditTag; + public string CASEditTag => LazyLoad(ref _CASEditTag, "TabData/@CASEditTag"); - // don't use the defined macro when creating a step tab for the step type's RNO - private LazyLoad _RNOExcludeMacros; - public bool RNOExcludeMacros - { - get - { - return LazyLoad(ref _RNOExcludeMacros, "TabData/@RNOExcludeMacros"); - } - } + // don't use the defined macro when creating a step tab for the step type's RNO + private LazyLoad _RNOExcludeMacros; + public bool RNOExcludeMacros => LazyLoad(ref _RNOExcludeMacros, "TabData/@RNOExcludeMacros"); - // Don't Align Tabs for numeric tabs that can go to 2 digits - Default is False - we do align numeric tabs - // - used in the Indian Point Unit 2 Background format (IP2BCK) - private LazyLoad _NoTabAlign; - public bool NoTabAlign - { - get - { - return LazyLoad(ref _NoTabAlign, "TabData/@NoTabAlign"); - } - } + // Don't Align Tabs for numeric tabs that can go to 2 digits - Default is False - we do align numeric tabs + // - used in the Indian Point Unit 2 Background format (IP2BCK) + private LazyLoad _NoTabAlign; + public bool NoTabAlign => LazyLoad(ref _NoTabAlign, "TabData/@NoTabAlign"); - // used for Caution and Note steps, include the step number along with the Caution or Note tab - // was put in for V.C. Summer Units 3 & 4 formats - private LazyLoad _IncludeStepNum; - public bool IncludeStepNum - { - get - { - return LazyLoad(ref _IncludeStepNum, "TabData/@IncludeStepNum"); - } - } - // used for Caution and Note steps, include the section number along with the Caution or Note tab - // - used with IncludeStepNum - // was put in for V.C. Summer Units 3 & 4 formats - private LazyLoad _IncludeSectionNum; - public bool IncludeSectionNum - { - get - { - return LazyLoad(ref _IncludeSectionNum, "TabData/@IncludeSectionNum"); - } - } - // used to center justify the resulting Caution or Note tab within the defined Caution or Note box - private LazyLoad _Justify; - public string Justify - { - get - { - return LazyLoad(ref _Justify, "TabData/@Justify"); - } - } + // used for Caution and Note steps, include the step number along with the Caution or Note tab + // was put in for V.C. Summer Units 3 & 4 formats + private LazyLoad _IncludeStepNum; + public bool IncludeStepNum => LazyLoad(ref _IncludeStepNum, "TabData/@IncludeStepNum"); + // used for Caution and Note steps, include the section number along with the Caution or Note tab + // - used with IncludeStepNum + // was put in for V.C. Summer Units 3 & 4 formats + private LazyLoad _IncludeSectionNum; + public bool IncludeSectionNum => LazyLoad(ref _IncludeSectionNum, "TabData/@IncludeSectionNum"); + // used to center justify the resulting Caution or Note tab within the defined Caution or Note box + private LazyLoad _Justify; + public string Justify => LazyLoad(ref _Justify, "TabData/@Justify"); - // put in for V.C. Summer's Transition Caution Transition Note types - The text of these types contain a transtion link and is used for the Caution or Note tab of the "normal" Caution or Note - used with IsTransition TabData flag - private LazyLoad _UsePreviousStyle; - public bool UsePreviousStyle - { - get - { - return LazyLoad(ref _UsePreviousStyle, "TabData/@UsePreviousStyle"); - } - } + // put in for V.C. Summer's Transition Caution Transition Note types - The text of these types contain a transtion link and is used for the Caution or Note tab of the "normal" Caution or Note - used with IsTransition TabData flag + private LazyLoad _UsePreviousStyle; + public bool UsePreviousStyle => LazyLoad(ref _UsePreviousStyle, "TabData/@UsePreviousStyle"); - // The text of these types contain a transtion link and is used for the Caution or Note tab of the "normal" Caution or Note - private LazyLoad _IsTransition; - public bool IsTransition - { - get - { - return LazyLoad(ref _IsTransition, "TabData/@IsTransition"); - } - } + // The text of these types contain a transtion link and is used for the Caution or Note tab of the "normal" Caution or Note + private LazyLoad _IsTransition; + public bool IsTransition => LazyLoad(ref _IsTransition, "TabData/@IsTransition"); - // set a hard-coded with of the step tab - private LazyLoad _IdentWidth; - public float? IdentWidth - { - get - { - return LazyLoad(ref _IdentWidth, "TabData/@IdentWidth"); - } - } + // set a hard-coded with of the step tab + private LazyLoad _IdentWidth; + public float? IdentWidth => LazyLoad(ref _IdentWidth, "TabData/@IdentWidth"); - // adjustment for step type's RNO tab width - private LazyLoad _RNOAdjustTabSize; - public float? RNOAdjustTabSize - { - get - { - return LazyLoad(ref _RNOAdjustTabSize, "TabData/@RNOAdjustTabSize"); - } - } + // adjustment for step type's RNO tab width + private LazyLoad _RNOAdjustTabSize; + public float? RNOAdjustTabSize => LazyLoad(ref _RNOAdjustTabSize, "TabData/@RNOAdjustTabSize"); - // adjustment to the horizontal position of the step tab's print macro - private LazyLoad _MacroTabAdjust; - public float? MacroTabAdjust - { - get - { - return LazyLoad(ref _MacroTabAdjust, "TabData/@MacroTabAdjust"); - } - } - // specified font to use for the step tab - private VE_Font _Font; + // adjustment to the horizontal position of the step tab's print macro + private LazyLoad _MacroTabAdjust; + public float? MacroTabAdjust => LazyLoad(ref _MacroTabAdjust, "TabData/@MacroTabAdjust"); + // specified font to use for the step tab + private VE_Font _Font; public VE_Font Font { get { if (_Font == null) { - XmlNode xn = vlnFormatDocument.LookupSingleStepNode(base.XmlNode, "TabData[Font]"); + XmlNode xn = vlnFormatDocument.LookupSingleStepNode(XmlNode, "TabData[Font]"); _Font = new VE_Font(xn); } return _Font; @@ -5863,63 +3684,32 @@ public StepData Equation // equation has a parent of embedded object. // gets the step tab's bull information if so defined private Bullet _Bullet; - public Bullet Bullet - { - get - { - return (_Bullet == null) ? _Bullet = new Bullet(base.XmlNode) : _Bullet; - } - } + public Bullet Bullet => _Bullet ?? (_Bullet = new Bullet(XmlNode)); - // will prevent white space from being removed before and after the Tab text - // - only used when tab justification is Centered - private LazyLoad _NoTrim; - public bool NoTrim - { - get - { - return LazyLoad(ref _NoTrim, "TabData/@NoTrim"); - } - } + // will prevent white space from being removed before and after the Tab text + // - only used when tab justification is Centered + private LazyLoad _NoTrim; + public bool NoTrim => LazyLoad(ref _NoTrim, "TabData/@NoTrim"); - // use the entire section number when building the step tab - existing logic looked for the text "Attachmen" then used the letter/number that followed it - private LazyLoad _UseEntireSectionNum; - public bool UseEntireSectionNum - { - get - { - return LazyLoad(ref _UseEntireSectionNum, "TabData/@UseEntireSectionNum"); - } - } + // use the entire section number when building the step tab - existing logic looked for the text "Attachmen" then used the letter/number that followed it + private LazyLoad _UseEntireSectionNum; + public bool UseEntireSectionNum => LazyLoad(ref _UseEntireSectionNum, "TabData/@UseEntireSectionNum"); - // this will remove white space before/after the sequential tab value - // put in for Vogtal Units 3 & 4 formats for continuous action sub-steps - // they have tab value within parenthesis and for a single digit/letter we don't want the white steps before or after it - private LazyLoad _TrimSeqTabValue; - public bool TrimSeqTabValue - { - get - { - return LazyLoad(ref _TrimSeqTabValue, "TabData/@TrimSeqTabValue"); - } - } + // this will remove white space before/after the sequential tab value + // put in for Vogtal Units 3 & 4 formats for continuous action sub-steps + // they have tab value within parenthesis and for a single digit/letter we don't want the white steps before or after it + private LazyLoad _TrimSeqTabValue; + public bool TrimSeqTabValue => LazyLoad(ref _TrimSeqTabValue, "TabData/@TrimSeqTabValue"); - } + } #endregion StepTab #region MacroList [TypeConverter(typeof(vlnListConverter))] public class MacroList : vlnNamedFormatList { public MacroList(XmlNodeList xmlNodeList) : base(xmlNodeList, null) { } - public override vlnNamedFormatList InheritedList - { - get - { - - return null; - } - } - } + public override vlnNamedFormatList InheritedList => null; + } #endregion MacroList #region Macro [TypeConverter(typeof(ExpandableObjectConverter))] @@ -5930,16 +3720,10 @@ public StepData Equation // equation has a parent of embedded object. // used to identify the tab's print macro private LazyLoad _Name; - public string Name - { - get - { - return LazyLoad(ref _Name, "@Name"); - } - } + public string Name => LazyLoad(ref _Name, "@Name"); - // the name of the print macro defined in the format's corresponding SVG (genmac) file - private LazyLoad _MacroDef; + // the name of the print macro defined in the format's corresponding SVG (genmac) file + private LazyLoad _MacroDef; public string MacroDef { get @@ -5963,38 +3747,20 @@ public StepData Equation // equation has a parent of embedded object. // hard coded horizontal addjustment used before printing the macro private LazyLoad _MacroXOffSet; - public float? MacroXOffSet - { - get - { - return LazyLoad(ref _MacroXOffSet, "@MacroXOffSet"); - } - } + public float? MacroXOffSet => LazyLoad(ref _MacroXOffSet, "@MacroXOffSet"); - // a width adjustment to the print macro (usually a negative value) - private LazyLoad _SingleColWidthAdjust; - public float? SingleColWidthAdjust - { - get - { - return LazyLoad(ref _SingleColWidthAdjust, "@SingleColWidthAdjust"); - } - } + // a width adjustment to the print macro (usually a negative value) + private LazyLoad _SingleColWidthAdjust; + public float? SingleColWidthAdjust => LazyLoad(ref _SingleColWidthAdjust, "@SingleColWidthAdjust"); - // locate the macro along with the tab's offset. - // however, if the tab is more than 2 characters long, adjust so that it aligns with the - // last two characters, not the first 2. - private LazyLoad _LocWithXOff; - public bool? LocWithXOff - { - get - { - return LazyLoad(ref _LocWithXOff, "@LocWithXOff"); - } - } + // locate the macro along with the tab's offset. + // however, if the tab is more than 2 characters long, adjust so that it aligns with the + // last two characters, not the first 2. + private LazyLoad _LocWithXOff; + public bool? LocWithXOff => LazyLoad(ref _LocWithXOff, "@LocWithXOff"); - // Groupings is used to only have the macro if there are N or more of the type in the grouping. - private LazyLoad _Grouping; + // Groupings is used to only have the macro if there are N or more of the type in the grouping. + private LazyLoad _Grouping; public int? Grouping { get @@ -6052,254 +3818,105 @@ public StepData Equation // equation has a parent of embedded object. // used by the step type to reference which box to use (Cautions, Notes) private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } - // This was added to support 3 line box for VC Summer Units 3 & 4 Alarms. It is only checked in the 'double line' vlnbox.cs code! - private LazyLoad _NumLines; - public int? NumLines - { - get - { - return LazyLoad(ref _NumLines, "@NumLines"); - } - } + public int? Index => LazyLoad(ref _Index, "@Index"); + // This was added to support 3 line box for VC Summer Units 3 & 4 Alarms. It is only checked in the 'double line' vlnbox.cs code! + private LazyLoad _NumLines; + public int? NumLines => LazyLoad(ref _NumLines, "@NumLines"); - // the column where the box starts printing - private LazyLoad _Start; - public float? Start - { - get - { - return LazyLoad(ref _Start, "@Start"); - } - } + // the column where the box starts printing + private LazyLoad _Start; + public float? Start => LazyLoad(ref _Start, "@Start"); - // the column where to stop printing the box - private LazyLoad _End; - public float? End - { - get - { - return LazyLoad(ref _End, "@End"); - } - } + // the column where to stop printing the box + private LazyLoad _End; + public float? End => LazyLoad(ref _End, "@End"); - // column position to start printing the text that is inside the box - private LazyLoad _TxtStart; - public float? TxtStart - { - get - { - return LazyLoad(ref _TxtStart, "@TxtStart"); - } - } + // column position to start printing the text that is inside the box + private LazyLoad _TxtStart; + public float? TxtStart => LazyLoad(ref _TxtStart, "@TxtStart"); - // the length of the text before it wraps to the next line - private LazyLoad _TxtWidth; - public float? TxtWidth - { - get - { - return LazyLoad(ref _TxtWidth, "@TxtWidth"); - } - } + // the length of the text before it wraps to the next line + private LazyLoad _TxtWidth; + public float? TxtWidth => LazyLoad(ref _TxtWidth, "@TxtWidth"); - // an absolute position from the left margin where the Caution or Note tab text (box header) is placed within the drawn box - used for boxed Cautions and/or Notes - Caution or Note tab justification needs to be "Centered" - private LazyLoad _TabPos; - public float? TabPos - { - get - { - return LazyLoad(ref _TabPos, "@TabPos"); - } - } + // an absolute position from the left margin where the Caution or Note tab text (box header) is placed within the drawn box - used for boxed Cautions and/or Notes - Caution or Note tab justification needs to be "Centered" + private LazyLoad _TabPos; + public float? TabPos => LazyLoad(ref _TabPos, "@TabPos"); - // F2024-078 adjusts the the spacing before the Note/Caution tab - the space betwee the top of the box and the tab text - private LazyLoad _AdjSpB4Tab; - public float? AdjSpB4Tab - { - get - { - return LazyLoad(ref _AdjSpB4Tab, "@AdjSpB4Tab"); - } - } + // F2024-078 adjusts the the spacing before the Note/Caution tab - the space betwee the top of the box and the tab text + private LazyLoad _AdjSpB4Tab; + public float? AdjSpB4Tab => LazyLoad(ref _AdjSpB4Tab, "@AdjSpB4Tab"); - // F2024-078 adjusts the the spacing after the Note/Caution tab - the space betwee the tab text and the first line of of Note/Caution text - private LazyLoad _AdjSpAftTab; - public float? AdjSpAftTab - { - get - { - return LazyLoad(ref _AdjSpAftTab, "@AdjSpAftTab"); - } - } + // F2024-078 adjusts the the spacing after the Note/Caution tab - the space betwee the tab text and the first line of of Note/Caution text + private LazyLoad _AdjSpAftTab; + public float? AdjSpAftTab => LazyLoad(ref _AdjSpAftTab, "@AdjSpAftTab"); - // F2024-078 adjusts the the spacing after the last line of Note/Caution text - between the last line of text and the bottom of the box - private LazyLoad _AdjLastBlnkLn; - public float? AdjLastBlnkLn - { - get - { - return LazyLoad(ref _AdjLastBlnkLn, "@AdjLastBlnkLn"); - } - } + // F2024-078 adjusts the the spacing after the last line of Note/Caution text - between the last line of text and the bottom of the box + private LazyLoad _AdjLastBlnkLn; + public float? AdjLastBlnkLn => LazyLoad(ref _AdjLastBlnkLn, "@AdjLastBlnkLn"); - // this will adjust the line spacing when an extra thick line is used for a box, so that the text below the box doesn't hit up against the bottom of the box - private LazyLoad _ThickDouble; // F2021-026: Barakah single column 2 thick double lines around Warnings - public bool ThickDouble - { - get - { - return LazyLoad(ref _ThickDouble, "@ThickDouble"); - } - } + // this will adjust the line spacing when an extra thick line is used for a box, so that the text below the box doesn't hit up against the bottom of the box + private LazyLoad _ThickDouble; // F2021-026: Barakah single column 2 thick double lines around Warnings + public bool ThickDouble => LazyLoad(ref _ThickDouble, "@ThickDouble"); - // the character used for the Upper Right Corner of the box - private LazyLoad _BXURC; - public string BXURC - { - get - { - return LazyLoad(ref _BXURC, "@BXURC"); - } - } + // the character used for the Upper Right Corner of the box + private LazyLoad _BXURC; + public string BXURC => LazyLoad(ref _BXURC, "@BXURC"); - // the character used to drawn the Horizontal line of the box - private LazyLoad _BXHorz; - public string BXHorz - { - get - { - return LazyLoad(ref _BXHorz, "@BXHorz"); - } - } + // the character used to drawn the Horizontal line of the box + private LazyLoad _BXHorz; + public string BXHorz => LazyLoad(ref _BXHorz, "@BXHorz"); - // the character used for the Upper Left Corner of the box - private LazyLoad _BXULC; - public string BXULC - { - get - { - return LazyLoad(ref _BXULC, "@BXULC"); - } - } - // the character used for the vertcal lines of the left and right sides of the box - private LazyLoad _BXVert; - public string BXVert - { - get - { - return LazyLoad(ref _BXVert, "@BXVert"); - } - } + // the character used for the Upper Left Corner of the box + private LazyLoad _BXULC; + public string BXULC => LazyLoad(ref _BXULC, "@BXULC"); + // the character used for the vertcal lines of the left and right sides of the box + private LazyLoad _BXVert; + public string BXVert => LazyLoad(ref _BXVert, "@BXVert"); - // the character used for the left side that connect to a horizontal line - // (usually the char looks like a T that is rotated to the left 90 degrees) - private LazyLoad _BXMLS; - public string BXMLS - { - get - { - return LazyLoad(ref _BXMLS, "@BXMLS"); - } - } + // the character used for the left side that connect to a horizontal line + // (usually the char looks like a T that is rotated to the left 90 degrees) + private LazyLoad _BXMLS; + public string BXMLS => LazyLoad(ref _BXMLS, "@BXMLS"); - // the character used for the right side that connect to a horizontal line - // (usually the char looks like a T that is rotated to the right 90 degrees) - private LazyLoad _BXMRS; - public string BXMRS - { - get - { - return LazyLoad(ref _BXMRS, "@BXMRS"); - } - } + // the character used for the right side that connect to a horizontal line + // (usually the char looks like a T that is rotated to the right 90 degrees) + private LazyLoad _BXMRS; + public string BXMRS => LazyLoad(ref _BXMRS, "@BXMRS"); - // the character used for the Lower (bottom) Right Corner of the box - private LazyLoad _BXLRC; - public string BXLRC - { - get - { - return LazyLoad(ref _BXLRC, "@BXLRC"); - } - } + // the character used for the Lower (bottom) Right Corner of the box + private LazyLoad _BXLRC; + public string BXLRC => LazyLoad(ref _BXLRC, "@BXLRC"); - // the character used for the Lower (bottom) Left Corner of the box - private LazyLoad _BXLLC; - public string BXLLC - { - get - { - return LazyLoad(ref _BXLLC, "@BXLLC"); - } - } + // the character used for the Lower (bottom) Left Corner of the box + private LazyLoad _BXLLC; + public string BXLLC => LazyLoad(ref _BXLLC, "@BXLLC"); - // character used in the middle of the box an intersection of four cells - // - looks like a big plus sign - private LazyLoad _BXMID; - public string BXMID - { - get - { - return LazyLoad(ref _BXMID, "@BXMID"); - } - } + // character used in the middle of the box an intersection of four cells + // - looks like a big plus sign + private LazyLoad _BXMID; + public string BXMID => LazyLoad(ref _BXMID, "@BXMID"); - // character used for the Lower Horizontal line (bottom of the box) - private LazyLoad _BXLHorz; - public string BXLHorz - { - get - { - return LazyLoad(ref _BXLHorz, "@BXLHorz"); - } - } - // character use on the top line of the box that will connect to a horizontal line in the next row of the box - // - looks like a "T" character - private LazyLoad _BXUMID; - public string BXUMID - { - get - { - return LazyLoad(ref _BXUMID, "@BXUMID"); - } - } + // character used for the Lower Horizontal line (bottom of the box) + private LazyLoad _BXLHorz; + public string BXLHorz => LazyLoad(ref _BXLHorz, "@BXLHorz"); + // character use on the top line of the box that will connect to a horizontal line in the next row of the box + // - looks like a "T" character + private LazyLoad _BXUMID; + public string BXUMID => LazyLoad(ref _BXUMID, "@BXUMID"); - // character use on the bottom line of the box that will connect to a horizontal line in the row above- looks like an upside down "T" character - private LazyLoad _BXLMID; - public string BXLMID - { - get - { - return LazyLoad(ref _BXLMID, "@BXLMID"); - } - } - // a specific font to use for the box drawing characters - private VE_Font _Font; - public VE_Font Font - { - get - { - return (_Font == null) ? _Font = new VE_Font(base.XmlNode) : _Font; - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}]", Index); } - public override string GetPDCategory() - { return "Box Definition"; } - public override string ToString() - { - return String.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}", - BXURC, BXHorz, BXULC, BXVert, BXMLS, BXMRS, BXLRC, BXLLC, BXMID, BXLHorz, BXUMID, BXLMID); - } - // this return string is used in a Switch/Case statement to determin the visual style of the box when printing - public string BoxStyle + // character use on the bottom line of the box that will connect to a horizontal line in the row above- looks like an upside down "T" character + private LazyLoad _BXLMID; + public string BXLMID => LazyLoad(ref _BXLMID, "@BXLMID"); + // a specific font to use for the box drawing characters + private VE_Font _Font; + public VE_Font Font => _Font ?? (_Font = new VE_Font(XmlNode)); + public override string GetPDDisplayName() => string.Format("[{0}]", Index); + public override string GetPDCategory() => "Box Definition"; + public override string ToString() => String.Format("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}", + BXURC, BXHorz, BXULC, BXVert, BXMLS, BXMRS, BXLRC, BXLLC, BXMID, BXLHorz, BXUMID, BXLMID); + // this return string is used in a Switch/Case statement to determin the visual style of the box when printing + public string BoxStyle { get { @@ -6334,274 +3951,113 @@ public StepData Equation // equation has a parent of embedded object. public class TransData : vlnFormatItem { private TransTypeList _TransTypeList; - public TransTypeList TransTypeList - { - get - { - return (_TransTypeList == null || _TransTypeList.MaxIndex == 0) ? _TransTypeList = new TransTypeList(SelectNodes("TransTypeData/TransTypes"), MyFormat) : _TransTypeList; - } - } - public TransData(XmlNode xmlNode) : base(xmlNode) { } + public TransTypeList TransTypeList => (_TransTypeList == null || _TransTypeList.MaxIndex == 0) ? _TransTypeList = new TransTypeList(SelectNodes("TransTypeData/TransTypes"), MyFormat) : _TransTypeList; + public TransData(XmlNode xmlNode) : base(xmlNode) { } // a character that is placed before and after the procedure title that's in the transition text private LazyLoad _DelimiterForTransitionTitle; - public string DelimiterForTransitionTitle - { - get - { - return LazyLoad(ref _DelimiterForTransitionTitle, "@DelimiterForTransitionTitle"); - } - } + public string DelimiterForTransitionTitle => LazyLoad(ref _DelimiterForTransitionTitle, "@DelimiterForTransitionTitle"); - // used to clean up step/sub-step delimeters so they are all just periods in transitions and are removed when getting step/sub-step tab for some reports - private LazyLoad _StepSubstepDelimeter; - public string StepSubstepDelimeter - { - get - { - return LazyLoad(ref _StepSubstepDelimeter, "@StepSubstepDelimeter"); - } - } + // used to clean up step/sub-step delimeters so they are all just periods in transitions and are removed when getting step/sub-step tab for some reports + private LazyLoad _StepSubstepDelimeter; + public string StepSubstepDelimeter => LazyLoad(ref _StepSubstepDelimeter, "@StepSubstepDelimeter"); - // string to use between the first step and last step of the transition ("Through" vs "Thur" etc.) - private LazyLoad _ThroughString; - public string ThroughString - { - get - { - return LazyLoad(ref _ThroughString, "@ThroughString"); - } - } + // string to use between the first step and last step of the transition ("Through" vs "Thur" etc.) + private LazyLoad _ThroughString; + public string ThroughString => LazyLoad(ref _ThroughString, "@ThroughString"); - // this will uppercase the transition text - private LazyLoad _CapsTransitions; - public bool CapsTransitions - { - get - { - return LazyLoad(ref _CapsTransitions, "@CapsTransitions"); - } - } + // this will uppercase the transition text + private LazyLoad _CapsTransitions; + public bool CapsTransitions => LazyLoad(ref _CapsTransitions, "@CapsTransitions"); - // this will uppercase the section title inside the transition - private LazyLoad _CapsTransitionsSection; - public bool CapsTransitionsSection - { - get - { - return LazyLoad(ref _CapsTransitionsSection, "@CapsTransitionsSection"); - } - } + // this will uppercase the section title inside the transition + private LazyLoad _CapsTransitionsSection; + public bool CapsTransitionsSection => LazyLoad(ref _CapsTransitionsSection, "@CapsTransitionsSection"); - // this will underline the transsition text - private LazyLoad _Underline; - public bool Underline - { - get - { - return LazyLoad(ref _Underline, "@Underline"); - } - } + // this will underline the transsition text + private LazyLoad _Underline; + public bool Underline => LazyLoad(ref _Underline, "@Underline"); - // add the high level step number to the sub-step tab in the transition - private LazyLoad _TStepNoFlag; - public bool TStepNoFlag - { - get - { - return LazyLoad(ref _TStepNoFlag, "@TStepNoFlag"); - } - } + // add the high level step number to the sub-step tab in the transition + private LazyLoad _TStepNoFlag; + public bool TStepNoFlag => LazyLoad(ref _TStepNoFlag, "@TStepNoFlag"); - // will uppercase AND in And transition type - private LazyLoad _UpcaseTranAnd; - public bool UpcaseTranAnd - { - get - { - return LazyLoad(ref _UpcaseTranAnd, "@UpcaseTranAnd"); - } - } + // will uppercase AND in And transition type + private LazyLoad _UpcaseTranAnd; + public bool UpcaseTranAnd => LazyLoad(ref _UpcaseTranAnd, "@UpcaseTranAnd"); - // will uppercase the first letter of each word in the transition - private LazyLoad _Cap1stCharTrans; - public bool Cap1stCharTrans - { - get - { - return LazyLoad(ref _Cap1stCharTrans, "@Cap1stCharTrans"); - } - } + // will uppercase the first letter of each word in the transition + private LazyLoad _Cap1stCharTrans; + public bool Cap1stCharTrans => LazyLoad(ref _Cap1stCharTrans, "@Cap1stCharTrans"); - // Title Case section title in the transition - private LazyLoad _Cap1stCharTransSection; - public bool Cap1stCharTransSection - { - get - { - return LazyLoad(ref _Cap1stCharTransSection, "@Cap1stCharTransSection"); - } - } - // Title Case Section Number in the transition - private LazyLoad _Cap1stCharTransSectionNumber; - public bool Cap1stCharTransSectionNumber - { - get - { - return LazyLoad(ref _Cap1stCharTransSectionNumber, "@Cap1stCharTransSectionNumber"); - } - } + // Title Case section title in the transition + private LazyLoad _Cap1stCharTransSection; + public bool Cap1stCharTransSection => LazyLoad(ref _Cap1stCharTransSection, "@Cap1stCharTransSection"); + // Title Case Section Number in the transition + private LazyLoad _Cap1stCharTransSectionNumber; + public bool Cap1stCharTransSectionNumber => LazyLoad(ref _Cap1stCharTransSectionNumber, "@Cap1stCharTransSectionNumber"); - // put parenthesis around section title - private LazyLoad _ParensAroundSectionTitle; - public bool ParensAroundSectionTitle - { - get - { - return LazyLoad(ref _ParensAroundSectionTitle, "@ParensAroundSectionTitle"); - } - } + // put parenthesis around section title + private LazyLoad _ParensAroundSectionTitle; + public bool ParensAroundSectionTitle => LazyLoad(ref _ParensAroundSectionTitle, "@ParensAroundSectionTitle"); - // turns on the option to add a page number to the transition BUT only for transition types 1, 2, and 4 - private LazyLoad _UseTransitionModifier; - public bool UseTransitionModifier - { - get - { - return LazyLoad(ref _UseTransitionModifier, "@UseTransitionModifier"); - } - } + // turns on the option to add a page number to the transition BUT only for transition types 1, 2, and 4 + private LazyLoad _UseTransitionModifier; + public bool UseTransitionModifier => LazyLoad(ref _UseTransitionModifier, "@UseTransitionModifier"); - // will include a page number with the transitions - will not turn on option box to add a the page number - private LazyLoad _UseSpecificTransitionModifier; - public bool UseSpecificTransitionModifier - { - get - { - return LazyLoad(ref _UseSpecificTransitionModifier, "@UseSpecificTransitionModifier"); - } - } + // will include a page number with the transitions - will not turn on option box to add a the page number + private LazyLoad _UseSpecificTransitionModifier; + public bool UseSpecificTransitionModifier => LazyLoad(ref _UseSpecificTransitionModifier, "@UseSpecificTransitionModifier"); - // the specific page number is always printed even if it is next or previous page, instead of using the 'Next Page' or 'Previous Page' text - private LazyLoad _UseSpecificPageNo; - public bool UseSpecificPageNo - { - get - { - return LazyLoad(ref _UseSpecificPageNo, "@UseSpecificPageNo"); - } - } + // the specific page number is always printed even if it is next or previous page, instead of using the 'Next Page' or 'Previous Page' text + private LazyLoad _UseSpecificPageNo; + public bool UseSpecificPageNo => LazyLoad(ref _UseSpecificPageNo, "@UseSpecificPageNo"); - // indclude the section number and section title when the {Sect Hdr} transition format token is used - set to False if we only want the section number - private LazyLoad _UseSecTitles; - public bool UseSecTitles - { - get - { - return LazyLoad(ref _UseSecTitles, "@UseSecTitles"); - } - } + // indclude the section number and section title when the {Sect Hdr} transition format token is used - set to False if we only want the section number + private LazyLoad _UseSecTitles; + public bool UseSecTitles => LazyLoad(ref _UseSecTitles, "@UseSecTitles"); - // turn on the section selection list for transitions that use the default steps section - private LazyLoad _DoSectionTransitions; - public bool DoSectionTransitions - { - get - { - return LazyLoad(ref _DoSectionTransitions, "@DoSectionTransitions"); - } - } - // having a default step section specified is not required for transitions with section information - private LazyLoad _NoDefaultSectReq; - public bool NoDefaultSectReq - { - get - { - return LazyLoad(ref _NoDefaultSectReq, "@NoDefaultSectReq"); - } - } + // turn on the section selection list for transitions that use the default steps section + private LazyLoad _DoSectionTransitions; + public bool DoSectionTransitions => LazyLoad(ref _DoSectionTransitions, "@DoSectionTransitions"); + // having a default step section specified is not required for transitions with section information + private LazyLoad _NoDefaultSectReq; + public bool NoDefaultSectReq => LazyLoad(ref _NoDefaultSectReq, "@NoDefaultSectReq"); - // replace spaces with hard spaces in procedure number - private LazyLoad _HardSpTranProcNumb; - public bool HardSpTranProcNumb - { - get - { - return LazyLoad(ref _HardSpTranProcNumb, "@HardSpTranProcNumb"); - } - } + // replace spaces with hard spaces in procedure number + private LazyLoad _HardSpTranProcNumb; + public bool HardSpTranProcNumb => LazyLoad(ref _HardSpTranProcNumb, "@HardSpTranProcNumb"); - // replaces the frist occurence of a space to a hard space - private LazyLoad _XchngTranSpForHard; - public bool XchngTranSpForHard - { - get - { - return LazyLoad(ref _XchngTranSpForHard, "@XchngTranSpForHard"); - } - } + // replaces the frist occurence of a space to a hard space + private LazyLoad _XchngTranSpForHard; + public bool XchngTranSpForHard => LazyLoad(ref _XchngTranSpForHard, "@XchngTranSpForHard"); - // Bold all of the transition text - private LazyLoad _BoldTransition; - public bool BoldTransition - { - get - { - return LazyLoad(ref _BoldTransition, "@BoldTransition"); - } - } + // Bold all of the transition text + private LazyLoad _BoldTransition; + public bool BoldTransition => LazyLoad(ref _BoldTransition, "@BoldTransition"); - // Bold the transition if it's not in a high level step - private LazyLoad _BoldTransitionExceptHLS; - public bool BoldTransitionExceptHLS - { - get - { - return LazyLoad(ref _BoldTransitionExceptHLS, "@BoldTransitionExceptHLS"); - } - } + // Bold the transition if it's not in a high level step + private LazyLoad _BoldTransitionExceptHLS; + public bool BoldTransitionExceptHLS => LazyLoad(ref _BoldTransitionExceptHLS, "@BoldTransitionExceptHLS"); - // B2017-269 Don't bold transition if a high level step or font for step is bold - private LazyLoad _BoldTransitionExceptBoldHLS; - public bool BoldTransitionExceptBoldHLS - { - get - { - return LazyLoad(ref _BoldTransitionExceptBoldHLS, "@BoldTransitionExceptBoldHLS"); - } - } + // B2017-269 Don't bold transition if a high level step or font for step is bold + private LazyLoad _BoldTransitionExceptBoldHLS; + public bool BoldTransitionExceptBoldHLS => LazyLoad(ref _BoldTransitionExceptBoldHLS, "@BoldTransitionExceptBoldHLS"); - // remove the "s" in "Procedure Steps" (section title) when transition references only one step - private LazyLoad _AdjustStepTransitionText; - public bool AdjustStepTransitionText - { - get - { - return LazyLoad(ref _AdjustStepTransitionText, "@AdjustStepTransitionText"); - } - } + // remove the "s" in "Procedure Steps" (section title) when transition references only one step + private LazyLoad _AdjustStepTransitionText; + public bool AdjustStepTransitionText => LazyLoad(ref _AdjustStepTransitionText, "@AdjustStepTransitionText"); - // remove the parent/child unit designators from the procedure number in the transition references - private LazyLoad _ProcLevelPCPC; - public bool ProcLevelPCPC // B2022-004: Remove Proc PC/PC token from transition text - { - get - { - return LazyLoad(ref _ProcLevelPCPC, "@ProcLevelPCPC"); - } - } + // remove the parent/child unit designators from the procedure number in the transition references + private LazyLoad _ProcLevelPCPC; + public bool ProcLevelPCPC // B2022-004: Remove Proc PC/PC token from transition text +=> LazyLoad(ref _ProcLevelPCPC, "@ProcLevelPCPC"); - // F2024-030 for Vogtle Units 3 & 4, added KeepOnePCPCTag flag to keep one of the PC/PC tokens when editing - // keep one of the parent/child unit designators in the transition reference - private LazyLoad _KeepOnePCPCTag; - public bool KeepOnePCPCTag - { - get - { - return LazyLoad(ref _KeepOnePCPCTag, "@KeepOnePCPCTag"); - } - } - } + // F2024-030 for Vogtle Units 3 & 4, added KeepOnePCPCTag flag to keep one of the PC/PC tokens when editing + // keep one of the parent/child unit designators in the transition reference + private LazyLoad _KeepOnePCPCTag; + public bool KeepOnePCPCTag => LazyLoad(ref _KeepOnePCPCTag, "@KeepOnePCPCTag"); + } #endregion TransData #region TransType [TypeConverter(typeof(ExpandableObjectConverter))] @@ -6612,77 +4068,36 @@ public StepData Equation // equation has a parent of embedded object. // allows us to re-define a default transition (from BASE format) and create new transition types private LazyLoad _Index; - public int? Index - { - get - { - return LazyLoad(ref _Index, "@Index"); - } - } + public int? Index => LazyLoad(ref _Index, "@Index"); - // Holdover from 16bit, used to define whether transitions are range (types 2 & 3). - // This is used in the logic for transitions with page numbers. This gets defined as "Type" in the code for the transition class. - // NOTE: the TransType you see in the code is actually the index into the list of transition definitions for given format. - private LazyLoad _Type; - public int? Type - { - get - { - return LazyLoad(ref _Type, "@TransType"); - } - } + // Holdover from 16bit, used to define whether transitions are range (types 2 & 3). + // This is used in the logic for transitions with page numbers. This gets defined as "Type" in the code for the transition class. + // NOTE: the TransType you see in the code is actually the index into the list of transition definitions for given format. + private LazyLoad _Type; + public int? Type => LazyLoad(ref _Type, "@TransType"); - // defines the contents that including in a Transition type. - private LazyLoad _TransFormat; - public string TransFormat - { - get - { - return LazyLoad(ref _TransFormat, "@TransFormat"); - } - } + // defines the contents that including in a Transition type. + private LazyLoad _TransFormat; + public string TransFormat => LazyLoad(ref _TransFormat, "@TransFormat"); - // defines what procedure information is selectable in the User Interface used to select a transition type to insert in the procedure text - private LazyLoad _TransUI; - public E_TransUI? TransUI - { - get - { - return LazyLoad(ref _TransUI, "@TransUI"); - } - } + // defines what procedure information is selectable in the User Interface used to select a transition type to insert in the procedure text + private LazyLoad _TransUI; + public E_TransUI? TransUI => LazyLoad(ref _TransUI, "@TransUI"); - // defines what is shown in list of transition types, on the User Interface used to select a transition type to insert in the procedure text - private LazyLoad _TransMenu; - public string TransMenu - { - get - { - return LazyLoad(ref _TransMenu, "@TransMenu"); - } - } + // defines what is shown in list of transition types, on the User Interface used to select a transition type to insert in the procedure text + private LazyLoad _TransMenu; + public string TransMenu => LazyLoad(ref _TransMenu, "@TransMenu"); - //B2019-072: For AEP, use PSI & SI for outside transition text. - // ex: UnitProcSetString ="{PSI:UNITCOM}-{SI:SETNAME}-{PSI:SETID|4023}-" will look for UNITCOM in - // the Procedure Specific Information, then SETNAME in the Set Specific Information (working draft), - // then the SETID in the Procedure Specific Information (or use 4023) if nothing is entered - private LazyLoad _UnitProcSetString; - public string UnitProcSetString - { - get - { - return LazyLoad(ref _UnitProcSetString, "@UnitProcSetString"); - } - } - public override string GetPDDisplayName() - { return string.Format("[{0}] - Type {1}", Index, Type); } - public override string GetPDCategory() - { return "Transition Type Data"; } - public override string ToString() - { - return string.Format("{0} - {1}", TransFormat, TransMenu); - } - } + //B2019-072: For AEP, use PSI & SI for outside transition text. + // ex: UnitProcSetString ="{PSI:UNITCOM}-{SI:SETNAME}-{PSI:SETID|4023}-" will look for UNITCOM in + // the Procedure Specific Information, then SETNAME in the Set Specific Information (working draft), + // then the SETID in the Procedure Specific Information (or use 4023) if nothing is entered + private LazyLoad _UnitProcSetString; + public string UnitProcSetString => LazyLoad(ref _UnitProcSetString, "@UnitProcSetString"); + public override string GetPDDisplayName() => string.Format("[{0}] - Type {1}", Index, Type); + public override string GetPDCategory() => "Transition Type Data"; + public override string ToString() => string.Format("{0} - {1}", TransFormat, TransMenu); + } #endregion TransType #region TransTypeList [TypeConverter(typeof(vlnIndexedListConverter))] @@ -6711,135 +4126,59 @@ public StepData Equation // equation has a parent of embedded object. //In a sequence of RO values, the unit appears with every value //(e.g., "25 gpm and 30 gpm" vs. "25 and 30 gpm") private LazyLoad _AllUnits; - public bool AllUnits - { - get - { - return LazyLoad(ref _AllUnits, "@AllUnits"); - } - } + public bool AllUnits => LazyLoad(ref _AllUnits, "@AllUnits"); - // If a R0 follows a "- " then it will be uppercased, THE "- " can be anywere in the text before the RO value - private LazyLoad _UpRoAftrDash; - public bool UpRoAftrDash - { - get - { - return LazyLoad(ref _UpRoAftrDash, "@UpRoAftrDash"); - } - } + // If a R0 follows a "- " then it will be uppercased, THE "- " can be anywere in the text before the RO value + private LazyLoad _UpRoAftrDash; + public bool UpRoAftrDash => LazyLoad(ref _UpRoAftrDash, "@UpRoAftrDash"); - // Put in for Wolf Creek, where the "- " should be right before the link for the RO to be uppercased. - private LazyLoad _UpRoImmAftrDashSpace; - public bool UpRoImmAftrDashSpace - { - get - { - return LazyLoad(ref _UpRoImmAftrDashSpace, "@UpRoImmAftrDashSpace"); - } - } + // Put in for Wolf Creek, where the "- " should be right before the link for the RO to be uppercased. + private LazyLoad _UpRoImmAftrDashSpace; + public bool UpRoImmAftrDashSpace => LazyLoad(ref _UpRoImmAftrDashSpace, "@UpRoImmAftrDashSpace"); - // Always uppercase the RO value units (PSI, GPM, etc.) - private LazyLoad _UpcaseAllRoUnits; - public bool UpcaseAllRoUnits - { - get - { - return LazyLoad(ref _UpcaseAllRoUnits, "@UpcaseAllRoUnits"); - } - } + // Always uppercase the RO value units (PSI, GPM, etc.) + private LazyLoad _UpcaseAllRoUnits; + public bool UpcaseAllRoUnits => LazyLoad(ref _UpcaseAllRoUnits, "@UpcaseAllRoUnits"); - // Forces the units for a RO to be uppercased for high level steps - private LazyLoad _CapHighRo; - public bool CapHighRo - { - get - { - return LazyLoad(ref _CapHighRo, "@CapHighRo"); - } - } + // Forces the units for a RO to be uppercased for high level steps + private LazyLoad _CapHighRo; + public bool CapHighRo => LazyLoad(ref _CapHighRo, "@CapHighRo"); - // uppercase ROs anywhere if no lower case text follows and an upper case letter immediately precedes the RO. - private LazyLoad _CapRoIfLastLower; - public bool CapRoIfLastLower - { - get - { - return LazyLoad(ref _CapRoIfLastLower, "@CapRoIfLastLower"); - } - } + // uppercase ROs anywhere if no lower case text follows and an upper case letter immediately precedes the RO. + private LazyLoad _CapRoIfLastLower; + public bool CapRoIfLastLower => LazyLoad(ref _CapRoIfLastLower, "@CapRoIfLastLower"); - // uppercase the RO, if it is a Setpoint type of RO, anywhere if no lower case text follows and an upper case letter immediately precedes the RO. - private LazyLoad _CapSPIfLastLower; - public bool CapSPIfLastLower - { - get - { - return LazyLoad(ref _CapSPIfLastLower, "@CapSPIfLastLower"); - } - } + // uppercase the RO, if it is a Setpoint type of RO, anywhere if no lower case text follows and an upper case letter immediately precedes the RO. + private LazyLoad _CapSPIfLastLower; + public bool CapSPIfLastLower => LazyLoad(ref _CapSPIfLastLower, "@CapSPIfLastLower"); - // Uppercase the RO Unit if the previous letter is uppercase - private LazyLoad _UpRoIfPrevUpper; - public bool UpRoIfPrevUpper - { - get - { - return LazyLoad(ref _UpRoIfPrevUpper, "@UpRoIfPrevUpper"); - } - } + // Uppercase the RO Unit if the previous letter is uppercase + private LazyLoad _UpRoIfPrevUpper; + public bool UpRoIfPrevUpper => LazyLoad(ref _UpRoIfPrevUpper, "@UpRoIfPrevUpper"); - // Underline all ROs, values and Units - private LazyLoad _UnderlineRo; - public bool UnderlineRo - { - get - { - return LazyLoad(ref _UnderlineRo, "@UnderlineRo"); - } - } + // Underline all ROs, values and Units + private LazyLoad _UnderlineRo; + public bool UnderlineRo => LazyLoad(ref _UnderlineRo, "@UnderlineRo"); - // Cap only the first letters of the units in a high level RO - // used in FLP (Turkey Point) format - private LazyLoad _CapFirstLetterInHighRO; - public bool CapFirstLetterInHighRO - { - get - { - return LazyLoad(ref _CapFirstLetterInHighRO, "@CapFirstLetterInHighRO"); - } - } + // Cap only the first letters of the units in a high level RO + // used in FLP (Turkey Point) format + private LazyLoad _CapFirstLetterInHighRO; + public bool CapFirstLetterInHighRO => LazyLoad(ref _CapFirstLetterInHighRO, "@CapFirstLetterInHighRO"); - // put in for Byron and Braidwood which has RO values containing non-PROMS procedure references as ROs. - // need to replace the unicode dash (\u8209?) with the dash character before the RO is resolved in order - // to retain the the upper and lower case lettering of the procedure number in the RO value (B2019-171) - private LazyLoad _DoSpaceDashBeforeROResolve; - public bool DoSpaceDashBeforeROResolve - { - get - { - return LazyLoad(ref _DoSpaceDashBeforeROResolve, "@DoSpaceDashBeforeROResolve"); - } - } - } + // put in for Byron and Braidwood which has RO values containing non-PROMS procedure references as ROs. + // need to replace the unicode dash (\u8209?) with the dash character before the RO is resolved in order + // to retain the the upper and lower case lettering of the procedure number in the RO value (B2019-171) + private LazyLoad _DoSpaceDashBeforeROResolve; + public bool DoSpaceDashBeforeROResolve => LazyLoad(ref _DoSpaceDashBeforeROResolve, "@DoSpaceDashBeforeROResolve"); + } #endregion RoData #endregion TransDataAll #region SupportClasses public class StepDataRetval { - private string _Name; - public string Name - { - get { return _Name; } - set { _Name = value; } - } - private int _Index; - public int Index - { - get { return _Index; } - set { _Index = value; } - } - public StepDataRetval(string name, int index) + public string Name { get; set; } + public int Index { get; set; } + public StepDataRetval(string name, int index) { Name = name; Index = index; diff --git a/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs b/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs index c7676e27..8748f16f 100644 --- a/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs +++ b/PROMS/VEPROMS.CSLA.Library/Format/vlnFormat.cs @@ -12,47 +12,14 @@ namespace VEPROMS.CSLA.Library private static XmlElement mydocele; public vlnFormatDocument(IFormatOrFormatInfo myFormat) { - _MyFormat = myFormat; + MyFormat = myFormat; LoadXml(MyFormat.Data); - mydocele = this.DocumentElement; + mydocele = DocumentElement; } - private IFormatOrFormatInfo _MyFormat; - public IFormatOrFormatInfo MyFormat + + public IFormatOrFormatInfo MyFormat { get; set; } + public static XmlNode LookupSingleNode(XmlNode xmlNode, string path) { - get { return _MyFormat; } - set { _MyFormat = value; } - } - public static XmlNode LookupSingleNode(XmlNode xmlNode, string path) - { - //original: - //if (xmlNode == null) return null; - //XmlNode xn = xmlNode.SelectSingleNode(path); - //if (xn != null) return xn; - //if (xmlNode.Name == "Step") xn = LookupSingleStepNode(xmlNode, path); - //if (xn != null) return xn; - //if (path.StartsWith("Font")) return LookupSingleFontNode(xmlNode, path); - //return InheritLookup(xmlNode, path); -/* RHM 20090821 - - if (path.StartsWith("Font")) - { - XmlNode xn = null; - if (xmlNode != null) - { - xn = xmlNode.SelectSingleNode(path); - // RHM 2008-12-15 - Added logic to keep looking if a blank attribute is found - if (xn != null && xn is XmlAttribute && (xn as XmlAttribute).Value != "") return xn; - //if (xn != null) return xn; - } - else - { - xmlNode = LookupSingleNode(mydocele.FirstChild, "/PlantFormat/FormatData"); - } - if (path.Contains("Font")) Console.WriteLine("vlnFormatDocument.LookupSingleNode {0},{1}", xmlNode.Name == "Step" ? "Step." + xmlNode.Attributes["Type"].Value : xmlNode.Name, path); - return LookupSingleFontNode(xmlNode, path); - } - else - { - */ if (xmlNode == null) return null; XmlNode xn = xmlNode.SelectSingleNode(path); if (xmlNode.Name == "Box") return xn; // if box, don't do inheritance. @@ -72,7 +39,6 @@ namespace VEPROMS.CSLA.Library if (xn != null) return xn; if (path.StartsWith("Font")) return LookupSingleFontNode(xmlNode, path); // Then do Font Inheritance return InheritLookup(xmlNode, path, false); -// } } public static XmlNode LookupSingleFontNode(XmlNode xmlNode, string path) { @@ -108,29 +74,15 @@ namespace VEPROMS.CSLA.Library if (xmlNode == null) return null; XmlNode xn = xmlNode.SelectSingleNode(path); - XmlNode tmpNode = xmlNode; - XmlNode tmpNode2 = xmlNode; + XmlNode tmpNode2 = xmlNode; while (xn == null) //Walk-up the format tree to find a step node { - //if (path.Contains("Font")) Console.WriteLine("vlnFormatDocument.LookupSingleStepNode -> Loop {0},{1}", xmlNode.Name == "Step" ? "Step." + xmlNode.Attributes["Type"].Value : xmlNode.Name, path); - tmpNode = xmlNode; - // RHM 20090831 Try doing a lookup of the parent. If no parent, go back to the original and do an inheritance lookup - XmlAttribute attr = xmlNode.Attributes["ParentType"]; + //if (path.Contains("Font")) Console.WriteLine("vlnFormatDocument.LookupSingleStepNode -> Loop {0},{1}", xmlNode.Name == "Step" ? "Step." + xmlNode.Attributes["Type"].Value : xmlNode.Name, path); + // RHM 20090831 Try doing a lookup of the parent. If no parent, go back to the original and do an inheritance lookup + XmlAttribute attr = xmlNode.Attributes["ParentType"]; if (attr == null || attr.Value == string.Empty) // Cannot find ParentType so do an InheritanceLookup return InheritLookup(tmpNode2, path, true); - //return InheritLookup(xmlNode, path, false); xmlNode = xmlNode.ParentNode.SelectSingleNode(string.Format("Step[@Type='{0}']", xmlNode.Attributes["ParentType"].InnerText)); - // Based upon our current data - the following conditions are never met. - //if (xmlNode == null && path.StartsWith("Font")) - //{ - // //if (path.Contains("Font")) Console.WriteLine("vlnFormatDocument.LookupSingleStepNode -> Font {0},{1}", tmpNode.Name == "Step" ? "Step." + tmpNode.Attributes["Type"].Value : tmpNode.Name, path); - // return LookupSingleFontNode(tmpNode, path); - //} - //if (xmlNode == null) - //{ - // //if (path.Contains("Font")) Console.WriteLine("vlnFormatDocument.LookupSingleStepNode -> Font {0},{1}", tmpNode2.Name == "Step" ? "Step." + tmpNode2.Attributes["Type"].Value : tmpNode2.Name, path); - // return InheritLookup(tmpNode2, path, true); - //} xn = xmlNode.SelectSingleNode(path); } return xn; @@ -145,38 +97,20 @@ namespace VEPROMS.CSLA.Library } public static string Lookup(XmlNode xmlNode, string path) { - //if (xmlNode == null) return null; XmlNode xn = LookupSingleNode(xmlNode, path); - //if (xn == null) xn = InheritLookup(xmlNode, path); - if (xn == null) return null; - return xn.InnerText; - } - //public static string StepLookup(XmlNode xmlNode, string path) - //{ - // //if (xmlNode == null) return null; - // XmlNode xn = LookupSingleStepNode(xmlNode, path); - // //if (xn == null) xn = InheritLookup(xmlNode, path); - // if (xn == null) return null; - // return xn.InnerText; - //} - public static T EnumLookup(XmlNode xmlNode, string path) + return xn?.InnerText; + } + public static T EnumLookup(XmlNode xmlNode, string path) { string str = Lookup(xmlNode,path); - if (str == null) return default(T); - return (T)Enum.Parse(typeof(T), str); - } - public static int? IntLookup(XmlNode xmlNode, string path) + return str == null ? default : (T)Enum.Parse(typeof(T), str); + } + public static int? IntLookup(XmlNode xmlNode, string path) { - //if (xmlNode == null) return null; - //XmlNode xn = LookupSingleNode(xmlNode, path); - //if (xn == null) xn = InheritLookup(xmlNode, path); - //if (xn == null) return null; - //return int.Parse(xn.InnerText); string str = Lookup(xmlNode, path); - if (str == null) return null; - return int.Parse(str); - } - public static int SiblingCount(XmlNode xmlNode) + return str == null ? null : (int?)int.Parse(str); + } + public static int SiblingCount(XmlNode xmlNode) { int retval = 0; string nodeName = xmlNode.Name; @@ -189,7 +123,7 @@ namespace VEPROMS.CSLA.Library public static string Path(XmlNode xmlNode) { // Walk the path - string parentPath = (xmlNode.ParentNode == xmlNode.OwnerDocument ? "" : Path(xmlNode.ParentNode)); + string parentPath = xmlNode.ParentNode == xmlNode.OwnerDocument ? "" : Path(xmlNode.ParentNode); // Count Siblings with the Same Name int sibCount = SiblingCount(xmlNode); return string.Format("{0}/{1}[{2}]", parentPath, xmlNode.Name, sibCount); @@ -204,7 +138,7 @@ namespace VEPROMS.CSLA.Library string TransIndex = xmlNode.Attributes["Index"].Value; xPath = System.Text.RegularExpressions.Regex.Replace(xPath, @"\[[0-9]*\]$", @"[@Index='" + TransIndex + @"']"); } - vlnFormatDocument fd = (vlnFormatDocument)(xmlNode.OwnerDocument);//First Get the vlnFormatDocument - This also ties it to a FormatInfo object + vlnFormatDocument fd = (vlnFormatDocument)xmlNode.OwnerDocument;//First Get the vlnFormatDocument - This also ties it to a FormatInfo object while(fd.MyFormat.MyIParent != null) { fd = fd.MyFormat.MyIParent.PlantFormat.XmlDoc;// Get the parents vlnFormatDocument @@ -215,8 +149,8 @@ namespace VEPROMS.CSLA.Library else xp = fd.SelectSingleNode(xPath);// Get the related node if (xp != null) { - XmlNode xn = null; - if (stepLookup) + XmlNode xn; + if (stepLookup) { //if (path.Contains("Font")) Console.WriteLine("vlnFormatItem.SelectSingleNode {0},{1}", xp.Name == "Step" ? "Step." + xp.Attributes["Type"].Value : xp.Name, path); xn = LookupSingleStepNode(xp, path); @@ -233,7 +167,7 @@ namespace VEPROMS.CSLA.Library { if (xmlNode == null) return null;// No path to match string xPath = Path(xmlNode);// Build xPath from xmlNode - vlnFormatDocument fd = (vlnFormatDocument)(xmlNode.OwnerDocument);//First Get the vlnFormatDocument - This also ties it to a FormatInfo object + vlnFormatDocument fd = (vlnFormatDocument)xmlNode.OwnerDocument;//First Get the vlnFormatDocument - This also ties it to a FormatInfo object while (fd.MyFormat.MyIParent != null) { fd = fd.MyFormat.MyIParent.PlantFormat.XmlDoc;// Get the parents vlnFormatDocument @@ -256,100 +190,41 @@ namespace VEPROMS.CSLA.Library [TypeConverter(typeof(ExpandableObjectConverter))] public class vlnFormatItem { - public vlnFormatItem(XmlNode xmlNode) - { - _XmlNode = xmlNode; - } - public vlnFormatItem() { } - XmlNode _XmlNode; - internal XmlNode XmlNode - { - get { return _XmlNode; } - set { _XmlNode = value; } - } - private IFormatOrFormatInfo _MyFormat; + public vlnFormatItem(XmlNode xmlNode) => XmlNode = xmlNode; + public vlnFormatItem() { } + + internal XmlNode XmlNode { get; set; } + private IFormatOrFormatInfo _MyFormat; public IFormatOrFormatInfo MyFormat { get { if (_MyFormat == null) { - vlnFormatDocument doc = (XmlNode.OwnerDocument) as vlnFormatDocument; - if(doc != null) - _MyFormat = doc.MyFormat; - } + if (XmlNode.OwnerDocument is vlnFormatDocument doc) + _MyFormat = doc.MyFormat; + } return _MyFormat; } } - private IFormatOrFormatInfo _MyParentFormat; - public IFormatOrFormatInfo MyParentFormat + public IFormatOrFormatInfo MyParentFormat => MyFormat.MyIParent; + public virtual string GetPDDisplayName() => ToString(); + public virtual string GetPDName() => ToString(); + public virtual string GetPDDescription() => ToString(); + public virtual string GetPDCategory() => ToString(); + public XmlNodeList SelectNodes(string path) => vlnFormatDocument.LookupNodes(XmlNode, path); + public XmlNode SelectSingleNode(string path) { - get - { - return MyFormat.MyIParent; - } - } - public virtual string GetPDDisplayName() - { return ToString(); } - public virtual string GetPDName() - { return ToString(); } - public virtual string GetPDDescription() - { return ToString(); } - public virtual string GetPDCategory() - { return ToString(); } - public XmlNodeList SelectNodes(string path) - { - return vlnFormatDocument.LookupNodes(_XmlNode, path); - } - public XmlNode SelectSingleNode(string path) - { - //AdjustLookup(_XmlNode, path); //if(path.Contains("Font")) Console.WriteLine("vlnFormatItem.SelectSingleNode {0},{1}", _XmlNode.Name == "Step" ? "Step." + _XmlNode.Attributes["Type"].Value : _XmlNode.Name, path); - return vlnFormatDocument.LookupSingleNode(_XmlNode, path); + return vlnFormatDocument.LookupSingleNode(XmlNode, path); } - //public static string _LookUpNode; - //private static void AdjustLookup(XmlNode xmlNode,string path) - //{ - // if (xmlNode.Name == "Step") - // { - // XmlAttribute attr = xmlNode.Attributes["Type"]; - // if (attr != null) _LookUpNode = attr.Value; - // //Console.WriteLine("AdjustLookup Type = {0}/{1}", _LookUpNode, path); - // } - // else - // { - // //Console.WriteLine("AdjustLookup {0}", xmlNode.Name); - // } - //} - public XmlNode SelectSingleFontNode(string path) - { - return vlnFormatDocument.LookupSingleFontNode(_XmlNode, path); - } - public string Lookup(string path) - { - return vlnFormatDocument.Lookup(_XmlNode, path); - } - public string Lookup(string path, ref string local) - { - return (local != null? local : local = Lookup(path)); - } - //public string StepLookup(string path) - //{ - // return vlnFormatDocument.StepLookup(_XmlNode, path); - //} - public int? IntLookup(string path) - { - return vlnFormatDocument.IntLookup(_XmlNode, path); - } - public int? IntLookup(string path, ref int? local) - { - return (local != null ? local : local = IntLookup(path)); - } - public T EnumLookup(string path) - { - return vlnFormatDocument.EnumLookup(_XmlNode, path); - } - public bool LazyLoad(ref LazyLoad ll, string xPath) + public XmlNode SelectSingleFontNode(string path) => vlnFormatDocument.LookupSingleFontNode(XmlNode, path); + public string Lookup(string path) => vlnFormatDocument.Lookup(XmlNode, path); + public string Lookup(string path, ref string local) => local ?? (local = Lookup(path)); + public int? IntLookup(string path) => vlnFormatDocument.IntLookup(XmlNode, path); + public int? IntLookup(string path, ref int? local) => local != null ? local : local = IntLookup(path); + public T EnumLookup(string path) => vlnFormatDocument.EnumLookup(XmlNode, path); + public bool LazyLoad(ref LazyLoad ll, string xPath) { if (ll == null) { @@ -358,12 +233,9 @@ namespace VEPROMS.CSLA.Library } return ll.Value; } - protected static bool RetrieveBool(XmlNode xn) - { - return xn != null && xn.InnerText.ToUpper() == "TRUE"; - } - // a LaxyLoad that allows you to pass in the default setting - public bool LazyLoad(ref LazyLoad ll, string xPath, bool defaultReturn) + protected static bool RetrieveBool(XmlNode xn) => xn != null && xn.InnerText.ToUpper() == "TRUE"; + // a LazyLoad that allows you to pass in the default setting + public bool LazyLoad(ref LazyLoad ll, string xPath, bool defaultReturn) { if (ll == null) { @@ -372,12 +244,9 @@ namespace VEPROMS.CSLA.Library } return ll.Value; } - // if nothing is set for this node, then use the passed in default value - protected static bool RetrieveBool(XmlNode xn, bool defaultReturn) - { - return (xn != null) ? xn.InnerText.ToUpper() == "TRUE" : defaultReturn; - } - public string LazyLoad(ref LazyLoad ll, string xPath) + // if nothing is set for this node, then use the passed in default value + protected static bool RetrieveBool(XmlNode xn, bool defaultReturn) => (xn != null) ? xn.InnerText.ToUpper() == "TRUE" : defaultReturn; + public string LazyLoad(ref LazyLoad ll, string xPath) { if (ll == null) { @@ -386,16 +255,13 @@ namespace VEPROMS.CSLA.Library } return ll.Value; } - protected static string RetrieveString(XmlNode xn) - { - return xn != null ? xn.InnerText : null; - } - public string MyPath + protected static string RetrieveString(XmlNode xn) => xn?.InnerText; + public string MyPath { get { StringBuilder sb = new StringBuilder(); - XmlNode node = _XmlNode; + XmlNode node = XmlNode; string prefix = ""; while (node != null) { @@ -429,14 +295,13 @@ namespace VEPROMS.CSLA.Library int? value = null; if (xn != null) { - int iValue = 0; - if (!int.TryParse(xn.InnerText, out iValue)) - { - if (xn.InnerText == "") return null; - Console.WriteLine(string.Format("'{0}'\r\n'{1}'\r\n'{2}' could not be converted to int?", MyFormat.FullName, MyPath + "/" + xPath, xn.InnerText)); - throw (new Exception(string.Format("{0} = '{1}' could not be converted to int?", xPath, xn.InnerText))); - } - value = iValue; + if (!int.TryParse(xn.InnerText, out int iValue)) + { + if (xn.InnerText == "") return null; + Console.WriteLine(string.Format("'{0}'\r\n'{1}'\r\n'{2}' could not be converted to int?", MyFormat.FullName, MyPath + "/" + xPath, xn.InnerText)); + throw new Exception(string.Format("{0} = '{1}' could not be converted to int?", xPath, xn.InnerText)); + } + value = iValue; } return value; } @@ -445,13 +310,12 @@ namespace VEPROMS.CSLA.Library float? value = null; if (xn != null) { - float fValue = 0; - if (!float.TryParse(xn.InnerText, out fValue)) - { - Console.WriteLine(string.Format("'{0}'\r\n'{1}'\r\n'{2}' could not be converted to float?", MyFormat.FullName, MyPath + "/" + xPath, xn.InnerText)); - throw (new Exception(string.Format("{0} = '{1}' could not be converted to float?", xPath, xn.InnerText))); - } - value = fValue; + if (!float.TryParse(xn.InnerText, out float fValue)) + { + Console.WriteLine(string.Format("'{0}'\r\n'{1}'\r\n'{2}' could not be converted to float?", MyFormat.FullName, MyPath + "/" + xPath, xn.InnerText)); + throw new Exception(string.Format("{0} = '{1}' could not be converted to float?", xPath, xn.InnerText)); + } + value = fValue; } return value; } @@ -460,9 +324,8 @@ namespace VEPROMS.CSLA.Library { if (ll == null) { - XmlNode xn = this._XmlNode; - xn = SelectSingleNode(xPath); - if (xn == null) + XmlNode xn = SelectSingleNode(xPath); + if (xn == null) ll = new LazyLoad(null); else if (xn.Value == "")// No value specified - Use zero value if it is defined - GetName returns a null if it is not defined ll = new LazyLoad>(Enum.GetName(typeof(T), 0) != null ? (Nullable) Enum.Parse(typeof(T), "0") : null); @@ -497,17 +360,10 @@ namespace VEPROMS.CSLA.Library #region LazyLoad public class LazyLoad { - public LazyLoad(T value) - { - _Value = value; - } - private T _Value; - public T Value - { - get { return _Value; } - set { _Value = value; } - } - } + public LazyLoad(T value) => Value = value; + + public T Value { get; set; } + } #endregion #region vlnFormatList, new() public class vlnFormatList : List, ICustomTypeDescriptor @@ -522,9 +378,11 @@ namespace VEPROMS.CSLA.Library _XmlNodeList = value; foreach (XmlNode xn in _XmlNodeList) { - T tt = new T(); - tt.XmlNode = xn; - Add(tt); + T tt = new T + { + XmlNode = xn + }; + Add(tt); } } } @@ -546,7 +404,7 @@ namespace VEPROMS.CSLA.Library XmlNode node = _XmlNodeList[0]; // Get the first node in a list vlnFormatDocument doc = null; if (node != null) - doc = (node.OwnerDocument) as vlnFormatDocument; // Get the owner document as a vlnFormatDocument + doc = node.OwnerDocument as vlnFormatDocument; // Get the owner document as a vlnFormatDocument if (doc != null) _MyFormat = doc.MyFormat; // Get the Format associated with the vlnFormatDocument } @@ -557,36 +415,24 @@ namespace VEPROMS.CSLA.Library _MyFormat = value; } } - #region ICustomTypeDescriptor - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - public virtual PropertyDescriptorCollection GetProperties() + #region ICustomTypeDescriptor + public string GetClassName() => TypeDescriptor.GetClassName(this, true); + public AttributeCollection GetAttributes() => TypeDescriptor.GetAttributes(this, true); + public string GetComponentName() => TypeDescriptor.GetComponentName(this, true); + public TypeConverter GetConverter() => TypeDescriptor.GetConverter(this, true); + public EventDescriptor GetDefaultEvent() => TypeDescriptor.GetDefaultEvent(this, true); + public PropertyDescriptor GetDefaultProperty() => TypeDescriptor.GetDefaultProperty(this, true); + public object GetEditor(Type editorBaseType) => TypeDescriptor.GetEditor(this, editorBaseType, true); + public EventDescriptorCollection GetEvents(Attribute[] attributes) => TypeDescriptor.GetEvents(this, attributes, true); + public EventDescriptorCollection GetEvents() => TypeDescriptor.GetEvents(this, true); + public object GetPropertyOwner(PropertyDescriptor pd) => this; + public PropertyDescriptorCollection GetProperties(Attribute[] attributes) => GetProperties(); + public virtual PropertyDescriptorCollection GetProperties() { // Create a collection object to hold property descriptors PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); - // Iterate the list - int i = 0; - for (i = 0; i < this.Count; i++) + // Iterate the list + for (int i = 0; i < Count; i++) { // Create a property descriptor for the item and add to the property descriptor collection pds.Add(new vlnPropertyDescriptor, T>(this, i)); @@ -601,13 +447,10 @@ namespace VEPROMS.CSLA.Library public class vlnIndexedFormatList : vlnFormatList, ICustomTypeDescriptor where T : vlnFormatItem,IVlnIndexedFormatItem, new() { - public vlnIndexedFormatList(XmlNodeList xmlNodeList,IFormatOrFormatInfo myFormat) : base(xmlNodeList) - { - MyFormat = myFormat; - } - public vlnIndexedFormatList() : base() { } - public virtual vlnIndexedFormatList InheritedList { get { return null; } } - public new T this[int index] + public vlnIndexedFormatList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat) : base(xmlNodeList) => MyFormat = myFormat; + public vlnIndexedFormatList() : base() { } + public virtual vlnIndexedFormatList InheritedList => null; + public new T this[int index] { get { @@ -620,8 +463,6 @@ namespace VEPROMS.CSLA.Library if (ttlParent != null) return ttlParent[index]; return null; - // None found - Can I find it in another format? - return null; } } public int MaxIndex @@ -657,36 +498,25 @@ namespace VEPROMS.CSLA.Library return max; } } - #region ICustomTypeDescriptor - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) + #region ICustomTypeDescriptor + public new string GetClassName() => TypeDescriptor.GetClassName(this, true); + public new AttributeCollection GetAttributes() => TypeDescriptor.GetAttributes(this, true); + public new string GetComponentName() => TypeDescriptor.GetComponentName(this, true); + public new TypeConverter GetConverter() => TypeDescriptor.GetConverter(this, true); + public new EventDescriptor GetDefaultEvent() => TypeDescriptor.GetDefaultEvent(this, true); + public new PropertyDescriptor GetDefaultProperty() => TypeDescriptor.GetDefaultProperty(this, true); + public new object GetEditor(Type editorBaseType) => TypeDescriptor.GetEditor(this, editorBaseType, true); + public new EventDescriptorCollection GetEvents(Attribute[] attributes) { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - public virtual PropertyDescriptorCollection GetProperties() + public new EventDescriptorCollection GetEvents() => TypeDescriptor.GetEvents(this, true); + public new object GetPropertyOwner(PropertyDescriptor pd) => this; + public new PropertyDescriptorCollection GetProperties(Attribute[] attributes) => GetProperties(); + public new virtual PropertyDescriptorCollection GetProperties() { // Create a collection object to hold property descriptors PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); // Iterate the list - int i = 0; - for (i = 0; i < this.Count; i++) + for (int i = 0; i < Count; i++) { // Create a property descriptor for the item and add to the property descriptor collection pds.Add(new vlnPropertyDescriptor, T>(this, i)); @@ -701,14 +531,11 @@ namespace VEPROMS.CSLA.Library public class vlnNamedFormatList : vlnFormatList, ICustomTypeDescriptor where T : vlnFormatItem, IVlnNamedFormatItem, new() { - public vlnNamedFormatList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat) - : base(xmlNodeList) - { - MyFormat = myFormat; - } - public vlnNamedFormatList() : base() { } - public virtual vlnNamedFormatList InheritedList { get { return null; } } - public new T this[string name] + public vlnNamedFormatList(XmlNodeList xmlNodeList, IFormatOrFormatInfo myFormat) + : base(xmlNodeList) => MyFormat = myFormat; + public vlnNamedFormatList() : base() { } + public virtual vlnNamedFormatList InheritedList => null; + public T this[string name] { get { @@ -721,8 +548,6 @@ namespace VEPROMS.CSLA.Library if (ttlParent != null) return ttlParent[name]; return null; - // None found - Can I find it in another format? - return null; } } public new T this[int index] @@ -735,47 +560,27 @@ namespace VEPROMS.CSLA.Library if (ttlParent != null) return ttlParent[index]; return null; - // None found - Can I find it in another format? - return null; } } - public new int Count - { - get - { - return base.Count; - } - } - #region ICustomTypeDescriptor - public String GetClassName() - { return TypeDescriptor.GetClassName(this, true); } - public AttributeCollection GetAttributes() - { return TypeDescriptor.GetAttributes(this, true); } - public String GetComponentName() - { return TypeDescriptor.GetComponentName(this, true); } - public TypeConverter GetConverter() - { return TypeDescriptor.GetConverter(this, true); } - public EventDescriptor GetDefaultEvent() - { return TypeDescriptor.GetDefaultEvent(this, true); } - public PropertyDescriptor GetDefaultProperty() - { return TypeDescriptor.GetDefaultProperty(this, true); } - public object GetEditor(Type editorBaseType) - { return TypeDescriptor.GetEditor(this, editorBaseType, true); } - public EventDescriptorCollection GetEvents(Attribute[] attributes) - { return TypeDescriptor.GetEvents(this, attributes, true); } - public EventDescriptorCollection GetEvents() - { return TypeDescriptor.GetEvents(this, true); } - public object GetPropertyOwner(PropertyDescriptor pd) - { return this; } - public PropertyDescriptorCollection GetProperties(Attribute[] attributes) - { return GetProperties(); } - public virtual PropertyDescriptorCollection GetProperties() + public new int Count => base.Count; + #region ICustomTypeDescriptor + public new string GetClassName() => TypeDescriptor.GetClassName(this, true); + public new AttributeCollection GetAttributes() => TypeDescriptor.GetAttributes(this, true); + public new string GetComponentName() => TypeDescriptor.GetComponentName(this, true); + public new TypeConverter GetConverter() => TypeDescriptor.GetConverter(this, true); + public new EventDescriptor GetDefaultEvent() => TypeDescriptor.GetDefaultEvent(this, true); + public new PropertyDescriptor GetDefaultProperty() => TypeDescriptor.GetDefaultProperty(this, true); + public new object GetEditor(Type editorBaseType) => TypeDescriptor.GetEditor(this, editorBaseType, true); + public new EventDescriptorCollection GetEvents(Attribute[] attributes) => TypeDescriptor.GetEvents(this, attributes, true); + public new EventDescriptorCollection GetEvents() => TypeDescriptor.GetEvents(this, true); + public new object GetPropertyOwner(PropertyDescriptor pd) => this; + public new PropertyDescriptorCollection GetProperties(Attribute[] attributes) => GetProperties(); + public new virtual PropertyDescriptorCollection GetProperties() { // Create a collection object to hold property descriptors PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); // Iterate the list - int i = 0; - for (i = 0; i < this.Count; i++) + for (int i = 0; i < Count; i++) { // Create a property descriptor for the item and add to the property descriptor collection pds.Add(new vlnPropertyDescriptor, T>(this, i)); @@ -793,16 +598,16 @@ namespace VEPROMS.CSLA.Library { private string Plural(string name) { - if (name.EndsWith("y")) return name.Substring(0, name.Length - 1) + "ies"; - if (name.EndsWith("ss")) return name + "es"; - else return name + "s"; + if (name.EndsWith("y")) return $"{name.Substring(0, name.Length - 1)}ies"; + if (name.EndsWith("ss")) return $"{name}es"; + else return $"{name}s"; } public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) { - if (destType == typeof(string) && value is T) + if (destType == typeof(string) && value is T vart) { // Return department and department role separated by comma. - return ((T)value).Count.ToString() + " " + (((T)value).Count == 1 ? typeof(C).Name : Plural(typeof(C).Name)); + return $"{vart.Count} {(vart.Count == 1 ? typeof(C).Name : Plural(typeof(C).Name))}"; } return base.ConvertTo(context, culture, value, destType); } @@ -815,17 +620,16 @@ namespace VEPROMS.CSLA.Library { private string Plural(string name) { - if (name.EndsWith("y")) return name.Substring(0, name.Length - 1) + "ies"; - if (name.EndsWith("ss")) return name + "es"; - if (name.EndsWith("x")) return name + "es"; - else return name + "s"; - } + if (name.EndsWith("y")) return $"{name.Substring(0, name.Length - 1)}ies"; + if (name.EndsWith("ss")) return $"{name}es"; + return name.EndsWith("x") ? $"{name}es" : $"{name}s"; + } public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) { - if (destType == typeof(string) && value is T) + if (destType == typeof(string) && value is T vart) { // Return department and department role separated by comma. - return ((T)value).MaxIndex.ToString() + " " + (((T)value).MaxIndex == 1 ? typeof(C).Name : Plural(typeof(C).Name)); + return $"{vart.MaxIndex} {(vart.MaxIndex == 1 ? typeof(C).Name : Plural(typeof(C).Name))}"; } return base.ConvertTo(context, culture, value, destType); } @@ -837,38 +641,23 @@ namespace VEPROMS.CSLA.Library where C : vlnFormatItem, new() { protected C _Item = null; - public vlnPropertyDescriptor(T itemList, int index) - : base("#" + index.ToString(), null) - { - _Item = itemList[index]; - } - public override bool CanResetValue(object component) - { return true; } - public override Type ComponentType - { get { return _Item.GetType(); } } - public override object GetValue(object component) - { return _Item; } - public override bool IsReadOnly - { get { return true; } } - public override Type PropertyType - { get { return _Item.GetType(); } } - public override void ResetValue(object component) + public vlnPropertyDescriptor(T itemList, int index) + : base("#" + index.ToString(), null) => _Item = itemList[index]; + public override bool CanResetValue(object component) => true; + public override Type ComponentType => _Item.GetType(); + public override object GetValue(object component) => _Item; + public override bool IsReadOnly => true; + public override Type PropertyType => _Item.GetType(); + public override void ResetValue(object component) { ;} - public override bool ShouldSerializeValue(object component) - { return true; } - public override void SetValue(object component, object value) + public override bool ShouldSerializeValue(object component) => true; + public override void SetValue(object component, object value) { /*_Item = value*/;} - //public override AttributeCollection Attributes - //{ get { return new AttributeCollection(null); } } - public override string DisplayName - { get { return _Item.GetPDDisplayName(); } } - public override string Description - { get { return _Item.GetPDDescription(); } } - public override string Name - { get { return _Item.GetPDName(); } } - public override string Category - { get { return _Item.GetPDCategory(); } } - } // Class + public override string DisplayName => _Item.GetPDDisplayName(); + public override string Description => _Item.GetPDDescription(); + public override string Name => _Item.GetPDName(); + public override string Category => _Item.GetPDCategory(); + } // Class #endregion } diff --git a/PROMS/VEPROMS.CSLA.Library/Minimal/AnnotationstypeSections.cs b/PROMS/VEPROMS.CSLA.Library/Minimal/AnnotationstypeSections.cs index c3af558b..c7b3637b 100644 --- a/PROMS/VEPROMS.CSLA.Library/Minimal/AnnotationstypeSections.cs +++ b/PROMS/VEPROMS.CSLA.Library/Minimal/AnnotationstypeSections.cs @@ -1,21 +1,9 @@ using System; -using System.Collections.Generic; -using System.Collections; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Data; using System.Data.SqlClient; -using System.Text.RegularExpressions; using Csla; -using Csla.Data; -using System.Configuration; -using System.IO; -using System.ComponentModel; -//namespace VEPROMS.CSLA.Library; - // C2025-027 this new file is used to support (data retrival) for selecting Annotation types to display on the Annotation screen. This is related to Annotation type filtering through V->Options. namespace VEPROMS.CSLA.Library @@ -70,8 +58,8 @@ namespace VEPROMS.CSLA.Library return dt; } - catch (Exception ex) - { + catch (Exception) + { //B2025-004 //if it fails loading previously open tabs, simply treat it as if no tabs were open //instead of crashing @@ -101,8 +89,8 @@ namespace VEPROMS.CSLA.Library return dt; } - catch (Exception ex) - { + catch (Exception) + { //B2025-004 //if it fails loading previously open tabs, simply treat it as if no tabs were open //instead of crashing @@ -132,7 +120,7 @@ namespace VEPROMS.CSLA.Library return dt; } - catch (Exception ex) + catch (Exception) { //B2025-004 //if it fails loading previously open tabs, simply treat it as if no tabs were open diff --git a/PROMS/VEPROMS.CSLA.Library/Minimal/ChangeBarAuditHistory.cs b/PROMS/VEPROMS.CSLA.Library/Minimal/ChangeBarAuditHistory.cs index cf1be7b0..e16b86f8 100644 --- a/PROMS/VEPROMS.CSLA.Library/Minimal/ChangeBarAuditHistory.cs +++ b/PROMS/VEPROMS.CSLA.Library/Minimal/ChangeBarAuditHistory.cs @@ -1,5 +1,4 @@ using System; -using Csla.Data; using System.Data; using System.Data.SqlClient; diff --git a/PROMS/VEPROMS.CSLA.Library/Minimal/GeneralReports.cs b/PROMS/VEPROMS.CSLA.Library/Minimal/GeneralReports.cs index 0eddc936..48a4c2cc 100644 --- a/PROMS/VEPROMS.CSLA.Library/Minimal/GeneralReports.cs +++ b/PROMS/VEPROMS.CSLA.Library/Minimal/GeneralReports.cs @@ -1,5 +1,4 @@ using System; -using Csla.Data; using System.Data; using System.Data.SqlClient; diff --git a/PROMS/VEPROMS.CSLA.Library/Minimal/Maintenance.cs b/PROMS/VEPROMS.CSLA.Library/Minimal/Maintenance.cs index e1c2cb0b..960899c4 100644 --- a/PROMS/VEPROMS.CSLA.Library/Minimal/Maintenance.cs +++ b/PROMS/VEPROMS.CSLA.Library/Minimal/Maintenance.cs @@ -1,5 +1,4 @@ using System; -using Csla.Data; using System.Data; using System.Data.SqlClient; diff --git a/PROMS/VEPROMS.CSLA.Library/Minimal/RevisionData.cs b/PROMS/VEPROMS.CSLA.Library/Minimal/RevisionData.cs index df2fb5cc..aec844cd 100644 --- a/PROMS/VEPROMS.CSLA.Library/Minimal/RevisionData.cs +++ b/PROMS/VEPROMS.CSLA.Library/Minimal/RevisionData.cs @@ -1,5 +1,4 @@ -using Csla.Data; -using System; +using System; using System.Data; using System.Data.SqlClient; using System.Linq; diff --git a/PROMS/VEPROMS.CSLA.Library/Minimal/UserReports.cs b/PROMS/VEPROMS.CSLA.Library/Minimal/UserReports.cs index 32f1cef3..f0e33720 100644 --- a/PROMS/VEPROMS.CSLA.Library/Minimal/UserReports.cs +++ b/PROMS/VEPROMS.CSLA.Library/Minimal/UserReports.cs @@ -1,5 +1,4 @@ using System; -using Csla.Data; using System.Data; using System.Data.SqlClient; diff --git a/PROMS/VEPROMS.CSLA.Library/VEObjects/VEDrillDown.cs b/PROMS/VEPROMS.CSLA.Library/VEObjects/VEDrillDown.cs index 1dee42e0..cb6457dd 100644 --- a/PROMS/VEPROMS.CSLA.Library/VEObjects/VEDrillDown.cs +++ b/PROMS/VEPROMS.CSLA.Library/VEObjects/VEDrillDown.cs @@ -1,6 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; using System.ComponentModel; namespace VEPROMS.CSLA.Library @@ -9,7 +6,6 @@ namespace VEPROMS.CSLA.Library public interface IVEDrillDownReadOnly { System.Collections.IList GetChildren(); // Returns a list of Business Objects - //bool ChildrenAreLoaded { get; }; // Have the Business Objects been Loaded bool HasChildren { get; } // Identifies if Children are available IVEDrillDownReadOnly ActiveParent { get; } FormatInfo ActiveFormat { get; } @@ -25,17 +21,6 @@ namespace VEPROMS.CSLA.Library bool IsProcedure { get; } bool IsSection { get; } bool IsStep { get; } - //IVEDrillDown Get(); - //bool HasStandardSteps(); - // Ideas Authorization - //bool CanLock(); - //bool CanUnlock(); - //bool CanOpen(); - //bool CanEdit(); - //bool CanAdmin(); - // Ideas Security - //bool Lock(string msg); - //bool Unlock(); } [TypeConverter(typeof(ExpandableObjectConverter))] public interface IVEDrillDown : IVEHasBrokenRules diff --git a/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs b/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs index 4ae00cc6..5090c8e3 100644 --- a/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs +++ b/PROMS/VEPROMS.CSLA.Library/VEObjects/VETreeNode.cs @@ -1,11 +1,6 @@ using System; -using System.Collections.Generic; -using System.Text; using System.Windows.Forms; -using Csla; using System.Collections; -using System.ComponentModel; -using System.Drawing; using System.Reflection; namespace VEPROMS.CSLA.Library @@ -14,35 +9,19 @@ namespace VEPROMS.CSLA.Library public class VETreeNodeEventArgs : EventArgs { public VETreeNodeEventArgs() { ; } - public VETreeNodeEventArgs(string info) + public VETreeNodeEventArgs(string info) => Info = info; + public VETreeNodeEventArgs(int value) => Value = value; + public VETreeNodeEventArgs(string info, int value) { - _Info = info; + Info = info; + Value = value; } - public VETreeNodeEventArgs(int value) - { - _Value = value; - } - public VETreeNodeEventArgs(string info, int value) - { - _Info = info; - _Value = value; - } - private int _Value; - public int Value - { - get { return _Value; } - set { _Value = value; } - } - private string _Info; + public int Value { get; set; } - public string Info - { - get { return _Info; } - set { _Info = value; } - } - - } + public string Info { get; set; } + + } public class VETreeNode : TreeNode { #region Events @@ -51,25 +30,13 @@ namespace VEPROMS.CSLA.Library public event VETreeNodeEvent LoadingChildrenMax; public event VETreeNodeEvent LoadingChildrenValue; public event VETreeNodeEvent LoadingChildrenDone; - private void OnLoadingChildrenSQL(object sender, VETreeNodeEventArgs args) - { - if (LoadingChildrenSQL != null) LoadingChildrenSQL(sender, args); - } - private void OnLoadingChildrenMax(object sender, VETreeNodeEventArgs args) - { - if (LoadingChildrenMax != null) LoadingChildrenMax(sender, args); - } - private void OnLoadingChildrenValue(object sender, VETreeNodeEventArgs args) - { - if (LoadingChildrenValue != null) LoadingChildrenValue(sender, args); - } - private void OnLoadingChildrenDone(object sender, VETreeNodeEventArgs args) - { - if (LoadingChildrenDone != null) LoadingChildrenDone(sender, args); - } - #endregion - #region Business Methods - protected IVEDrillDownReadOnly _VEObject; + private void OnLoadingChildrenSQL(object sender, VETreeNodeEventArgs args) => LoadingChildrenSQL?.Invoke(sender, args); + private void OnLoadingChildrenMax(object sender, VETreeNodeEventArgs args) => LoadingChildrenMax?.Invoke(sender, args); + private void OnLoadingChildrenValue(object sender, VETreeNodeEventArgs args) => LoadingChildrenValue?.Invoke(sender, args); + private void OnLoadingChildrenDone(object sender, VETreeNodeEventArgs args) => LoadingChildrenDone?.Invoke(sender, args); + #endregion + #region Business Methods + protected IVEDrillDownReadOnly _VEObject; public IVEDrillDownReadOnly VEObject { get { return _VEObject; } @@ -80,11 +47,6 @@ namespace VEPROMS.CSLA.Library ResetNode("Dummy Set_VEObject"); } } - //public void Refresh() - //{ - // if (_VEObject != null) - // Text = _VEObject.ToString(); - //} // Only load the Children Once protected bool _ChildrenLoaded = false; public bool ChildrenLoaded @@ -104,16 +66,11 @@ namespace VEPROMS.CSLA.Library get { return _InChildWindow; } set { _InChildWindow = value; } } - // Reset Node - //public void CloseNode() - //{ - // ResetNode(); - //} private void SetProperty(string name) { PropertyInfo propertyInfoObj = _VEObject.GetType().GetProperty(name); if (propertyInfoObj == null) return; - PropertyInfo propertyInfoThis = this.GetType().GetProperty(name); + PropertyInfo propertyInfoThis = GetType().GetProperty(name); if (propertyInfoThis == null) return; try { @@ -129,7 +86,7 @@ namespace VEPROMS.CSLA.Library if (_VEObject!=null && _VEObject.HasChildren && _ChildrenLoaded == false && CheckForParts()) { _ChildrenLoaded = false;// Reset the children loaded flag - this.Nodes.Add(dummy);// Add a Dummy Node so that the item will appear to be expanable. + Nodes.Add(dummy);// Add a Dummy Node so that the item will appear to be expanable. } else { @@ -167,38 +124,8 @@ namespace VEPROMS.CSLA.Library tn.ResetNode("Dummy GetFolder"); return tn; } -// public abstract void LoadChildren(); - //private long _Start; - //private Dictionary _Timings=new Dictionary(); - //private void tReset() - //{ - // _Timings = new Dictionary(); - // _Start = DateTime.Now.Ticks; - //} - //private void tNext(string msg) - //{ - // long tEnd = DateTime.Now.Ticks; - // long tDiff = tEnd - _Start; - // if (_Timings.ContainsKey(msg)) tDiff += _Timings[msg]; - // _Timings[msg] = tDiff; - // _Start = DateTime.Now.Ticks; - //} - //private void tShowResults() - //{ - // Console.WriteLine("Timings"); - // long total=0; - // foreach (string msg in _Timings.Keys) - // { - // total += _Timings[msg]; - // Console.WriteLine("{0}\t\"{1}\"", TimeSpan.FromTicks(_Timings[msg]).TotalMilliseconds, msg); - // } - // Console.WriteLine("{0}\t\"Total\"", TimeSpan.FromTicks(total).TotalMilliseconds); - //} - public virtual void LoadChildren() - { - LoadChildren(true); - } - private bool _allParts = true; + public virtual void LoadChildren() => LoadChildren(true); + private bool _allParts = true; private bool _excludeTablesFigsEqu = false; // used for inserting Step Text transitions (BNPP) public virtual void LoadChildren(bool allParts, bool excldTablesFigEq = false) { @@ -207,33 +134,23 @@ namespace VEPROMS.CSLA.Library _excludeTablesFigsEqu = excldTablesFigEq; if (!_ChildrenLoaded) { - this.Nodes.Clear(); - //tReset(); + Nodes.Clear(); DateTime tStart = DateTime.Now; - //TVAddChildren(_VEObject, this); OnLoadingChildrenSQL(this, new VETreeNodeEventArgs()); IList ol; - ItemInfo item = _VEObject as ItemInfo; - if (item != null) item.RefreshItemParts(); - if (_VEObject.GetType() == typeof(StepInfo) || _VEObject.GetType() == typeof(SectionInfo) || _VEObject.GetType() == typeof(ItemInfo)) + if (_VEObject is ItemInfo item) item.RefreshItemParts(); + if (_VEObject.GetType() == typeof(StepInfo) || _VEObject.GetType() == typeof(SectionInfo) || _VEObject.GetType() == typeof(ItemInfo)) ol = ((ItemInfo)_VEObject).GetChildren(allParts); else ol = _VEObject.GetChildren(); - //tNext("GetChildren"); if (ol != null) { OnLoadingChildrenMax(this, new VETreeNodeEventArgs(ol.Count)); - //this.TreeView.BeginUpdate(); - if (this.TreeView != null) this.TreeView.BeginUpdate(); + if (TreeView != null) TreeView.BeginUpdate(); else _MyLog.WarnFormat("TreeView.BeginUpdate - Null"); ExpandChildren(ol); - //} - //tNext("Set Nodes"); - //this.TreeView.EndUpdate(); - if (this.TreeView != null) this.TreeView.EndUpdate(); + if (TreeView != null) TreeView.EndUpdate(); else _MyLog.WarnFormat("TreeView.EndUpdate - Null"); - //tNext("End Update"); - //tShowResults(); } _ChildrenLoaded = true; OnLoadingChildrenDone(this, new VETreeNodeEventArgs(TimeSpan.FromTicks(DateTime.Now.Ticks - tStart.Ticks).TotalSeconds.ToString())); @@ -247,7 +164,6 @@ namespace VEPROMS.CSLA.Library foreach (IVEDrillDownReadOnly o in ol) { OnLoadingChildrenValue(this, new VETreeNodeEventArgs(++icnt)); - //tNext("Cycle"); try { bool skipIt = false; @@ -277,18 +193,14 @@ namespace VEPROMS.CSLA.Library tmp.ExpandChildren(o.GetChildren()); tmp._ChildrenLoaded = true; } - // OLD: RHM 20100115 : I don't think that the following lines are necessary since the "new VETreeNode(o)" - // above includes a similar function. - //else - // tmp.Nodes.Add(string.Format("dummy: {0}", o.GetType().Name));// Add a Dummy Node so that the item will appear to be expanable. } else tmp._ChildrenLoaded = true;// Reset the children loaded flag if (lastWasSection) - this.Nodes.Insert(0, tmp); + Nodes.Insert(0, tmp); // B2024-019 don't show Tables, Figures, or Equations in step tree when inserting Text Transitions else if (!_excludeTablesFigsEqu || !isTableFigEqu) - this.Nodes.Add(tmp); + Nodes.Add(tmp); // if last thing was section & this is step, do insert - i.e. so that steps go before sections. lastWasSection = (o is PartInfo && (o as PartInfo).PartType == E_FromType.Section); } @@ -302,16 +214,15 @@ namespace VEPROMS.CSLA.Library private void TVAddChildren(IVEDrillDownReadOnly veobj, VETreeNode tn) { OnLoadingChildrenSQL(tn, new VETreeNodeEventArgs()); - IList ol; - ItemInfo item = veobj as ItemInfo; - if (veobj.GetType() == typeof(StepInfo) || veobj.GetType() == typeof(SectionInfo) || veobj.GetType() == typeof(ItemInfo)) + IList ol; + if (veobj.GetType() == typeof(StepInfo) || veobj.GetType() == typeof(SectionInfo) || veobj.GetType() == typeof(ItemInfo)) ol = ((ItemInfo)veobj).GetChildren(true); else ol = veobj.GetChildren(); if (ol != null) { OnLoadingChildrenMax(this, new VETreeNodeEventArgs(ol.Count)); - this.TreeView.BeginUpdate(); + TreeView.BeginUpdate(); int icnt = 0; foreach (IVEDrillDownReadOnly o in ol) { @@ -333,46 +244,36 @@ namespace VEPROMS.CSLA.Library Console.WriteLine("{0}\r\n{1}", ex.Message, ex.InnerException); } } - - //} - this.TreeView.EndUpdate(); + TreeView.EndUpdate(); } } void myItemInfo_Deleted(object sender) { - VETreeNode parnode = Parent as VETreeNode; - if (parnode == null) return; - PartInfo pi = parnode.VEObject as PartInfo; - Remove(); - // get rid of 'Steps', 'RNOs', i.e. grouping nodes, if there are no children. - if (pi != null && parnode.Nodes.Count == 0) + if (!(Parent is VETreeNode parnode)) return; + Remove(); + // get rid of 'Steps', 'RNOs', i.e. grouping nodes, if there are no children. + if (parnode.VEObject is PartInfo && parnode.Nodes.Count == 0) { - VETreeNode grndparnode = parnode.Parent as VETreeNode; - parnode.Remove(); - // if only 'Steps' node is left, move steps 'up' a level. - if (grndparnode != null && grndparnode.Nodes.Count == 1) + parnode.Remove(); + // if only 'Steps' node is left, move steps 'up' a level. + if (parnode.Parent is VETreeNode grndparnode && grndparnode.Nodes.Count == 1) { VETreeNode sibnode = grndparnode.Nodes[0] as VETreeNode; - PartInfo pisib = sibnode.VEObject as PartInfo; - if (pisib != null && (pisib.ToString() == "Steps")) - { - if (!sibnode.ChildrenLoaded) sibnode.LoadChildren(); - while (sibnode.Nodes.Count > 0) - { - VETreeNode tmp = sibnode.Nodes[0] as VETreeNode; - tmp.Remove(); - grndparnode.Nodes.Add(tmp); - } - sibnode.Remove(); - } - } + if (sibnode.VEObject is PartInfo pisib && (pisib.ToString() == "Steps")) + { + if (!sibnode.ChildrenLoaded) sibnode.LoadChildren(); + while (sibnode.Nodes.Count > 0) + { + VETreeNode tmp = sibnode.Nodes[0] as VETreeNode; + tmp.Remove(); + grndparnode.Nodes.Add(tmp); + } + sibnode.Remove(); + } + } } } - //public IVEReadOnlyItem GetCsla() - //{ - // return _VEObject; - //} #endregion #region Factory Methods // Constructors @@ -383,25 +284,24 @@ namespace VEPROMS.CSLA.Library _allParts = allParts; _VEObject = o;// Save the BusinessObject ResetNode("Dummy VETreeNode(IVEDrillDownReadOnly o)"); - ItemInfo myItemInfo = o as ItemInfo; - if (myItemInfo != null) - { - myItemInfo.Deleted -= new ItemInfoEvent(myItemInfo_Deleted); - myItemInfo.Deleted += new ItemInfoEvent(myItemInfo_Deleted); - myItemInfo.ChildrenDeleted -= new ItemInfoEvent(myItemInfo_ChildrenDeleted); - myItemInfo.ChildrenDeleted += new ItemInfoEvent(myItemInfo_ChildrenDeleted); - myItemInfo.MyContent.Changed -= new ContentInfoEvent(NodeText_Changed); - myItemInfo.MyContent.Changed += new ContentInfoEvent(NodeText_Changed); - myItemInfo.OrdinalChanged -= new ItemInfoEvent(NodeText_Changed); - myItemInfo.OrdinalChanged += new ItemInfoEvent(NodeText_Changed); - myItemInfo.NewSiblingAfter -= new ItemInfoInsertEvent(myItemInfo_NewSiblingAfter); - myItemInfo.NewSiblingAfter += new ItemInfoInsertEvent(myItemInfo_NewSiblingAfter); - myItemInfo.NewSiblingBefore -= new ItemInfoInsertEvent(myItemInfo_NewSiblingBefore); - myItemInfo.NewSiblingBefore += new ItemInfoInsertEvent(myItemInfo_NewSiblingBefore); - myItemInfo.NewChild -= new ItemInfoInsertEvent(myItemInfo_NewChild); - myItemInfo.NewChild += new ItemInfoInsertEvent(myItemInfo_NewChild); - } - } + if (o is ItemInfo myItemInfo) + { + myItemInfo.Deleted -= new ItemInfoEvent(myItemInfo_Deleted); + myItemInfo.Deleted += new ItemInfoEvent(myItemInfo_Deleted); + myItemInfo.ChildrenDeleted -= new ItemInfoEvent(myItemInfo_ChildrenDeleted); + myItemInfo.ChildrenDeleted += new ItemInfoEvent(myItemInfo_ChildrenDeleted); + myItemInfo.MyContent.Changed -= new ContentInfoEvent(NodeText_Changed); + myItemInfo.MyContent.Changed += new ContentInfoEvent(NodeText_Changed); + myItemInfo.OrdinalChanged -= new ItemInfoEvent(NodeText_Changed); + myItemInfo.OrdinalChanged += new ItemInfoEvent(NodeText_Changed); + myItemInfo.NewSiblingAfter -= new ItemInfoInsertEvent(myItemInfo_NewSiblingAfter); + myItemInfo.NewSiblingAfter += new ItemInfoInsertEvent(myItemInfo_NewSiblingAfter); + myItemInfo.NewSiblingBefore -= new ItemInfoInsertEvent(myItemInfo_NewSiblingBefore); + myItemInfo.NewSiblingBefore += new ItemInfoInsertEvent(myItemInfo_NewSiblingBefore); + myItemInfo.NewChild -= new ItemInfoInsertEvent(myItemInfo_NewChild); + myItemInfo.NewChild += new ItemInfoInsertEvent(myItemInfo_NewChild); + } + } void NodeText_Changed(object sender) { Text = _VEObject.ToString(); @@ -422,7 +322,7 @@ namespace VEPROMS.CSLA.Library if (myItemInfo.Sections != null && myItemInfo.Sections.Count > 0 && myItemInfo.ActiveFormat.PlantFormat.FormatData.SectData.UseMetaSections) { // see if change in children tree nodes. - this.Nodes.Clear(); + Nodes.Clear(); _ChildrenLoaded = false; LoadChildren(true); } @@ -433,25 +333,24 @@ namespace VEPROMS.CSLA.Library { _VEObject = o;// Save the BusinessObject ResetNode("Dummy VETreeNode(IVEDrillDownReadOnly o)"); - ItemInfo myItemInfo = o as ItemInfo; - if (myItemInfo != null) - { - myItemInfo.Deleted -= new ItemInfoEvent(myItemInfo_Deleted); - myItemInfo.Deleted += new ItemInfoEvent(myItemInfo_Deleted); - myItemInfo.ChildrenDeleted -= new ItemInfoEvent(myItemInfo_ChildrenDeleted); - myItemInfo.ChildrenDeleted += new ItemInfoEvent(myItemInfo_ChildrenDeleted); - myItemInfo.MyContent.Changed -= new ContentInfoEvent(NodeText_Changed); - myItemInfo.MyContent.Changed += new ContentInfoEvent(NodeText_Changed); - myItemInfo.OrdinalChanged -= new ItemInfoEvent(NodeText_Changed); - myItemInfo.OrdinalChanged += new ItemInfoEvent(NodeText_Changed); - myItemInfo.NewSiblingAfter -= new ItemInfoInsertEvent(myItemInfo_NewSiblingAfter); - myItemInfo.NewSiblingAfter += new ItemInfoInsertEvent(myItemInfo_NewSiblingAfter); - myItemInfo.NewSiblingBefore -= new ItemInfoInsertEvent(myItemInfo_NewSiblingBefore); - myItemInfo.NewSiblingBefore += new ItemInfoInsertEvent(myItemInfo_NewSiblingBefore); - myItemInfo.NewChild -= new ItemInfoInsertEvent(myItemInfo_NewChild); - myItemInfo.NewChild += new ItemInfoInsertEvent(myItemInfo_NewChild); - } - } + if (o is ItemInfo myItemInfo) + { + myItemInfo.Deleted -= new ItemInfoEvent(myItemInfo_Deleted); + myItemInfo.Deleted += new ItemInfoEvent(myItemInfo_Deleted); + myItemInfo.ChildrenDeleted -= new ItemInfoEvent(myItemInfo_ChildrenDeleted); + myItemInfo.ChildrenDeleted += new ItemInfoEvent(myItemInfo_ChildrenDeleted); + myItemInfo.MyContent.Changed -= new ContentInfoEvent(NodeText_Changed); + myItemInfo.MyContent.Changed += new ContentInfoEvent(NodeText_Changed); + myItemInfo.OrdinalChanged -= new ItemInfoEvent(NodeText_Changed); + myItemInfo.OrdinalChanged += new ItemInfoEvent(NodeText_Changed); + myItemInfo.NewSiblingAfter -= new ItemInfoInsertEvent(myItemInfo_NewSiblingAfter); + myItemInfo.NewSiblingAfter += new ItemInfoInsertEvent(myItemInfo_NewSiblingAfter); + myItemInfo.NewSiblingBefore -= new ItemInfoInsertEvent(myItemInfo_NewSiblingBefore); + myItemInfo.NewSiblingBefore += new ItemInfoInsertEvent(myItemInfo_NewSiblingBefore); + myItemInfo.NewChild -= new ItemInfoInsertEvent(myItemInfo_NewChild); + myItemInfo.NewChild += new ItemInfoInsertEvent(myItemInfo_NewChild); + } + } void myItemInfo_ChildrenDeleted(object sender) { @@ -469,8 +368,7 @@ namespace VEPROMS.CSLA.Library { int nextItemID = args.ItemInserted.NextItem.ItemID; VETreeNode nextNode = FindChildOrGrandChild(nextItemID); - if(nextNode != null) - nextNode.myItemInfo_NewSiblingBefore(sender, args); + nextNode?.myItemInfo_NewSiblingBefore(sender, args); return; } if (args.ItemInserted.MyPrevious != null) // insert after @@ -486,317 +384,65 @@ namespace VEPROMS.CSLA.Library Nodes.Clear(); _ChildrenLoaded = false; ResetNode("Dummy myItemInfo_NewChild"); - ItemInfo item = VEObject as ItemInfo; - if (isExpanded && item != null && item.MyContent.ContentPartCount > 1) // || args.ItemInserted.NextItem != null || args.ItemInserted.MyPrevious != null)) - Expand(); - else - Collapse(); - } + if (isExpanded && VEObject is ItemInfo item && item.MyContent.ContentPartCount > 1) // || args.ItemInserted.NextItem != null || args.ItemInserted.MyPrevious != null)) + Expand(); + else + Collapse(); + } private VETreeNode FindChildOrGrandChild(int itemID) { foreach (TreeNode childNode in Nodes) { - VETreeNode child = childNode as VETreeNode; - if (child != null) - { - ItemInfo item = child.VEObject as ItemInfo; - if (item != null && item.ItemID == itemID) - return child; - } - } + if (childNode is VETreeNode child) + { + if (child.VEObject is ItemInfo item && item.ItemID == itemID) + return child; + } + } foreach (TreeNode childNode in Nodes) { - VETreeNode child = childNode as VETreeNode; - if (child != null && child.VEObject is PartInfo) - foreach (VETreeNode grandchild in child.Nodes) - { - ItemInfo item = grandchild.VEObject as ItemInfo; - if (item != null && item.ItemID == itemID) - return grandchild; - } - } + if (childNode is VETreeNode child && child.VEObject is PartInfo) + foreach (VETreeNode grandchild in child.Nodes) + { + if (grandchild.VEObject is ItemInfo item && item.ItemID == itemID) + return grandchild; + } + } return null; } void myItemInfo_NewSiblingBefore(object sender, ItemInfoInsertEventArgs args) { - if (this.Parent != null) // Only do this if the node has a parent - RHM 20100106 + if (Parent != null) // Only do this if the node has a parent - RHM 20100106 { - ItemInfo ii = args.ItemInserted as ItemInfo; - if (ii == null) - this.Parent.Nodes.Insert(Index, (new VETreeNode(args.ItemInserted))); - else // B2020-142: Can't get properties of restored item (no treeview context menu would be correct after restore) - { - if (ii.IsProcedure) this.Parent.Nodes.Insert(Index, (new VETreeNode(ProcedureInfo.Get(ii.ItemID)))); - if (ii.IsSection) this.Parent.Nodes.Insert(Index, (new VETreeNode(SectionInfo.Get(ii.ItemID)))); - if (ii.IsStep) this.Parent.Nodes.Insert(Index, (new VETreeNode(StepInfo.Get(ii.ItemID)))); - } - } + if (!(args.ItemInserted is ItemInfo ii)) + Parent.Nodes.Insert(Index, (new VETreeNode(args.ItemInserted))); + else // B2020-142: Can't get properties of restored item (no treeview context menu would be correct after restore) + { + if (ii.IsProcedure) Parent.Nodes.Insert(Index, (new VETreeNode(ProcedureInfo.Get(ii.ItemID)))); + if (ii.IsSection) Parent.Nodes.Insert(Index, (new VETreeNode(SectionInfo.Get(ii.ItemID)))); + if (ii.IsStep) Parent.Nodes.Insert(Index, (new VETreeNode(StepInfo.Get(ii.ItemID)))); + } + } } void myItemInfo_NewSiblingAfter(object sender, ItemInfoInsertEventArgs args) { - if (this.Parent != null) // Only do this if the node has a parent - RHM 20100106 + if (Parent != null) // Only do this if the node has a parent - RHM 20100106 { - ItemInfo ii = args.ItemInserted as ItemInfo; - if (ii == null) - this.Parent.Nodes.Insert(Index + 1, (new VETreeNode(args.ItemInserted))); - else // B2020-142: Can't get properties of restored item (no treeview context menu would be correct after restore) - { - if (ii.IsProcedure) this.Parent.Nodes.Insert(Index + 1, (new VETreeNode(ProcedureInfo.Get(ii.ItemID)))); - if (ii.IsSection) this.Parent.Nodes.Insert(Index + 1, (new VETreeNode(SectionInfo.Get(ii.ItemID)))); - if (ii.IsStep) this.Parent.Nodes.Insert(Index + 1, (new VETreeNode(StepInfo.Get(ii.ItemID)))); - } - } + if (!(args.ItemInserted is ItemInfo ii)) + Parent.Nodes.Insert(Index + 1, (new VETreeNode(args.ItemInserted))); + else // B2020-142: Can't get properties of restored item (no treeview context menu would be correct after restore) + { + if (ii.IsProcedure) Parent.Nodes.Insert(Index + 1, (new VETreeNode(ProcedureInfo.Get(ii.ItemID)))); + if (ii.IsSection) Parent.Nodes.Insert(Index + 1, (new VETreeNode(SectionInfo.Get(ii.ItemID)))); + if (ii.IsStep) Parent.Nodes.Insert(Index + 1, (new VETreeNode(StepInfo.Get(ii.ItemID)))); + } + } } public VETreeNode(string s) : base(s) { _VEObject = null;// Save the BusinessObject - //ResetNode(); } #endregion } - //public class VETreeNodeBase : VETreeNode - //where T : VETreeNode, new() - //{ - // #region Factory Methods - // private static int _ICount = 0; - // public VETreeNodeBase(string s) : base(s) { ;} - // public VETreeNodeBase(IVEReadOnlyItem o) : base(o) { ;} - // protected VETreeNodeBase() : base() { - // } - // private DateTime tNext(DateTime tStart, string msg) - // { - // DateTime tEnd = DateTime.Now; - // TimeSpan ts = new TimeSpan(tEnd.Ticks-tStart.Ticks); - // Console.WriteLine("{0} - {1}", ts.TotalMilliseconds, msg); - // return tEnd; - // } - // public override void LoadChildren() - // { - // if (!_ChildrenLoaded) - // { - // this.Nodes.Clear(); - // "".TrimEnd("\r\n".ToCharArray()); - // IList ol = _VEObject.GetChildren(); - // if (ol != null) - // { - // this.TreeView.BeginUpdate(); - // DateTime tStart = DateTime.Now; - // T[] tmpa = new T[ol.Count]; - // tStart = tNext(tStart, "Allocate Array"); - // for (int i = 0; i < ol.Count; i++) tmpa[i] = new T(); - // tStart = tNext(tStart, "Allocate Nodes"); - // int ii = 0; - // foreach (IVEReadOnlyItem o in ol) - // { - // try - // { - // tmpa[ii++].VEObject = o; - // } - // catch (Exception ex) - // { - // Console.WriteLine("{0}\r\n{1}", ex.Message, ex.InnerException); - // } - // } - // tStart = tNext(tStart, "Set Nodes"); - // for (int i = 0; i < ol.Count; i++) tmpa[i].ResetNode(); - // tStart = tNext(tStart, "Reset Nodes"); - // this.Nodes.AddRange(tmpa); - // tStart = tNext(tStart, "Add Range"); - // //foreach (IVEReadOnlyItem o in ol) - // //{ - // // try - // // { - // // T tmp = new T(); - // // tmp.VEObject = o; - // // this.Nodes.Add(tmp); - // // } - // // catch (Exception ex) - // // { - // // Console.WriteLine("{0}\r\n{1}", ex.Message, ex.InnerException); - // // } - // //} - // this.TreeView.EndUpdate(); - // } - // _ChildrenLoaded = true; - // } - // } - //#endregion - //} - /* - public class VEFolder : VETreeNodeBase - { - public static VEFolder GetFolder(int folderID) - { - return new VEFolder(FolderInfo.Get(folderID)); - } - //public static VEFolder LoadTree() - //{ - // VEFolder root = null; - // FolderInfoList fil = FolderInfoList.Get(); - // Dictionary dicMissing = new Dictionary(); - // Dictionary dicExists = new Dictionary(); - // foreach (FolderInfo fi in fil) - // { - // VEFolder ftp = null; - // if (dicExists.ContainsKey(fi.ParentID)) - // { - // ftp = dicExists[fi.ParentID]; - // } - // else - // { - // if (fi.ParentID != fi.FolderID) - // { - // ftp = new VEFolder(fi.ParentID.ToString()); - // dicMissing.Add(fi.ParentID, ftp); - // dicExists.Add(fi.ParentID, ftp); - // } - // } - // VEFolder ft = null; - // if (dicMissing.ContainsKey(fi.FolderID)) - // { - // ft = dicMissing[fi.FolderID]; - // ft.VEObject = fi; - // dicMissing.Remove(fi.FolderID); - // } - // else - // { - // ft = new VEFolder(fi); - // dicExists.Add(fi.FolderID, ft); - // } - // if (fi.ParentID == fi.FolderID) - // root = ft; - // else - // ftp.Nodes.Add(ft); - // } - // //root.FindTree = dicExists; - // return root; - //} - private VEFolder(string s) : base(s) { ;} - public VEFolder(IVEReadOnlyItem o) : base(o) { ;} - } - public class VEVersion : VETreeNodeBase { } - public class VEProcedure : VETreeNodeBase - { - //public override void LoadChildren() - //{ - // if (!_ChildrenLoaded) - // { - // this.Nodes.Clear(); - // Dictionary dicSect = new Dictionary(); - // SectionInfoList ol = (SectionInfoList)_VEObject.GetChildren(); - // if (ol != null) - // { - // foreach (SectionInfo o in ol) - // { - // try - // { - // VESection tmp = new VESection(); - // tmp.VEObject = o; - // if (dicSect.ContainsKey(o.PPath)) - // dicSect[o.PPath].Nodes.Add(tmp); - // else - // this.Nodes.Add(tmp); - // dicSect[o.Path] = tmp; - // } - // catch (Exception ex) - // { - // Console.WriteLine("{0}\r\n{1}", ex.Message, ex.InnerException); - // } - // } - // } - // _ChildrenLoaded = true; - // } - //} - } - public class VESection : VETreeNodeBase { } - public class VEStep : VETreeNodeBase { } - */ - //public class VETree : VETreeNodeBase - //{ - // public VETree() { ;} - // public static VETree GetFolder(int folderID) - // { - // return new VETree(FolderInfo.Get(folderID)); - // } - // //private VEFolder(string s) : base(s) { ;} - // public VETree(IVEReadOnlyItem o) : base(o) { ;} - //} - //public class VETree : VETreeNode - //{ - // public VETree() { ;} - // public static VETree GetFolder(int folderID) - // { - // VETree tn = new VETree(FolderInfo.Get(folderID)); - // tn.ResetNode(); - // return tn; - // } - // //private VEFolder(string s) : base(s) { ;} - // public VETree(IVEReadOnlyItem o) : base(o) { ;} - // private DateTime tNext(DateTime tStart, string msg) - // { - // DateTime tEnd = DateTime.Now; - // TimeSpan ts = new TimeSpan(tEnd.Ticks - tStart.Ticks); - // Console.WriteLine("{0} - {1}", ts.TotalMilliseconds, msg); - // return tEnd; - // } - // public override void LoadChildren() - // { - // if (!_ChildrenLoaded) - // { - // this.Nodes.Clear(); - // "".TrimEnd("\r\n".ToCharArray()); - // IList ol = _VEObject.GetChildren(); - // if (ol != null) - // { - // this.TreeView.BeginUpdate(); - // DateTime tStart = DateTime.Now; - // //VETree[] tmpa = new VETree[ol.Count]; - // //tStart = tNext(tStart, "Allocate Array"); - // ////for (int i = 0; i < ol.Count; i++) tmpa[i] = new VETree(); - // ////tStart = tNext(tStart, "Allocate Nodes"); - // //int ii = 0; - // //foreach (IVEReadOnlyItem o in ol) - // //{ - // // try - // // { - // // tmpa[ii++] = new VETree(o); - // // //tmpa[ii++].VEObject = o; - // // } - // // catch (Exception ex) - // // { - // // Console.WriteLine("{0}\r\n{1}", ex.Message, ex.InnerException); - // // } - // //} - // //tStart = tNext(tStart, "Set Nodes"); - // //for (int i = 0; i < ol.Count; i++) tmpa[i].ResetNode(); - // //tStart = tNext(tStart, "Reset Nodes"); - // //this.Nodes.AddRange(tmpa); - // //tStart = tNext(tStart, "Add Range"); - // this.TreeView.DrawMode = TreeViewDrawMode.OwnerDrawAll; - // foreach (IVEReadOnlyItem o in ol) - // { - // try - // { - // VETree tmp = new VETree(o); - // //tmp.VEObject = o; - // this.Nodes.Add(tmp); - // } - // catch (Exception ex) - // { - // Console.WriteLine("{0}\r\n{1}", ex.Message, ex.InnerException); - // } - // } - // tStart = tNext(tStart, "Set Nodes"); - // this.TreeView.DrawMode = TreeViewDrawMode.Normal; - // tStart = tNext(tStart, "DrawMode"); - // this.TreeView.EndUpdate(); - // tStart = tNext(tStart, "End Update"); - // this.TreeView.Refresh(); - // tStart = tNext(tStart, "Refresh"); - // } - // _ChildrenLoaded = true; - // } - // } - //} }