Continuous Action Summary logic
Added a LazyLoad that passes in the default value
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user