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

@@ -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)