Continuous Action Summary logic

Added a LazyLoad that passes in the default value
This commit is contained in:
2015-10-23 18:13:53 +00:00
parent 17d4c2b26b
commit 8708d0bbfc
4 changed files with 114 additions and 12 deletions

View File

@@ -3792,6 +3792,14 @@ namespace VEPROMS.CSLA.Library
return (_TableOfContentsData == null ? _TableOfContentsData = new TableOfContentsData(SelectSingleNode("TableOfContentsData")) : _TableOfContentsData);
}
}
private ConitnuousActionSummaryData _ContinuousActionSummaryData;
public ConitnuousActionSummaryData ContinuousActionSummaryData
{
get
{
return (_ContinuousActionSummaryData == null? _ContinuousActionSummaryData = new ConitnuousActionSummaryData(SelectSingleNode("ConitnuousActionSummaryData")) : _ContinuousActionSummaryData);
}
}
}
#endregion
#region TableOfContentsData
@@ -3889,6 +3897,28 @@ namespace VEPROMS.CSLA.Library
}
}
#endregion
#region ConitnuousActionSummary
public class ConitnuousActionSummaryData : vlnFormatItem
{
public ConitnuousActionSummaryData(XmlNode xmlNode) : base(xmlNode) { }
private LazyLoad<bool> _IncludeSectionNumAndTitle;
public bool IncludeSectionNumAndTitle
{
get
{
return LazyLoad(ref _IncludeSectionNumAndTitle, "@IncludeSectionNumAndTitle");
}
}
private VE_Font _Font;
public VE_Font Font
{
get
{
return (_Font == null) ? _Font = new VE_Font(base.XmlNode) : _Font;
}
}
}
#endregion
#endregion
#region MetaSectionAll
#region MetaSection
@@ -4690,6 +4720,14 @@ namespace VEPROMS.CSLA.Library
{
return string.Format("{0}", Type);
}
private LazyLoad<bool> _ExcludeFromContActSum;
public bool ExcludeFromContActSum
{
get
{
return LazyLoad(ref _ExcludeFromContActSum, "@ExcludeFromContActSum", true); // the default setting is true (as is yes, dont include on Continuous Action Summary)
}
}
}
#endregion
#region StepDataList

View File

@@ -353,6 +353,21 @@ namespace VEPROMS.CSLA.Library
{
return xn != null && xn.InnerText.ToUpper() == "TRUE";
}
// a LaxyLoad that allows you to pass in the default setting
public bool LazyLoad(ref LazyLoad<bool> ll, string xPath, bool defaultReturn)
{
if (ll == null)
{
XmlNode xn = SelectSingleNode(xPath);
ll = new LazyLoad<bool>(RetrieveBool(xn, defaultReturn));
}
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<string> ll, string xPath)
{
if (ll == null)