CSLA Config cleanup
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Xml;
|
||||
|
||||
@@ -47,12 +45,9 @@ namespace VEPROMS.CSLA.Library
|
||||
set { _ParentLookup = value; }
|
||||
}
|
||||
[NonSerialized]
|
||||
XmlDocument _XmlContents;
|
||||
public XmlDocument XmlContents
|
||||
{
|
||||
get { return _XmlContents; }
|
||||
}
|
||||
private XmlNode GetGroup(string group)
|
||||
readonly XmlDocument _XmlContents;
|
||||
public XmlDocument XmlContents => _XmlContents;
|
||||
private XmlNode GetGroup(string group)
|
||||
{
|
||||
XmlNodeList xl = _XmlContents.DocumentElement.SelectNodes(string.Format("//{0}", group));
|
||||
if(xl.Count == 0 && System.Text.RegularExpressions.Regex.IsMatch(group,"^[A-Za-z0-9]+$"))
|
||||
@@ -72,7 +67,6 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
private XmlAttribute GetItem(XmlNode xx, string item)
|
||||
{
|
||||
//XmlNodeList xl = xx.SelectNodes(string.Format("@{0}", item));
|
||||
XmlNodeList xl = xx.SelectNodes(
|
||||
string.Format("@*[translate(local-name(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')='{0}']", item.ToLower()));
|
||||
switch (xl.Count)
|
||||
@@ -87,11 +81,8 @@ namespace VEPROMS.CSLA.Library
|
||||
throw new XmlPropertiesException("Found more than one node @{0}", item);
|
||||
}
|
||||
}
|
||||
public string ParentValue(string group, string item)
|
||||
{
|
||||
return OnLookInAncestor(this, new XMLPropertiesArgs(group, item, true));
|
||||
}
|
||||
public string this[string group, string item]
|
||||
public string ParentValue(string group, string item) => OnLookInAncestor(this, new XMLPropertiesArgs(group, item, true));
|
||||
public string this[string group, string item]
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -162,41 +153,26 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
public partial class XMLPropertiesArgs
|
||||
{
|
||||
#region Business Methods
|
||||
private string _Group;
|
||||
public string Group
|
||||
{
|
||||
get { return _Group; }
|
||||
set { _Group = value; }
|
||||
}
|
||||
private string _Item;
|
||||
public string Item
|
||||
{
|
||||
get { return _Item; }
|
||||
set { _Item = value; }
|
||||
}
|
||||
private bool _AncestorLookup;
|
||||
#region Business Methods
|
||||
public string Group { get; set; }
|
||||
public string Item { get; set; }
|
||||
|
||||
public bool AncestorLookup
|
||||
{
|
||||
get { return _AncestorLookup; }
|
||||
set { _AncestorLookup = value; }
|
||||
}
|
||||
public bool AncestorLookup { get; set; }
|
||||
|
||||
#endregion
|
||||
#region Factory Methods
|
||||
private XMLPropertiesArgs() { ;}
|
||||
#endregion
|
||||
#region Factory Methods
|
||||
private XMLPropertiesArgs() { ;}
|
||||
public XMLPropertiesArgs(string group, string item)
|
||||
{
|
||||
_Group=group;
|
||||
_Item=item;
|
||||
_AncestorLookup = false;
|
||||
Group=group;
|
||||
Item=item;
|
||||
AncestorLookup = false;
|
||||
}
|
||||
public XMLPropertiesArgs(string group, string item, bool ancestorLookup)
|
||||
{
|
||||
_Group = group;
|
||||
_Item = item;
|
||||
_AncestorLookup = ancestorLookup;
|
||||
Group = group;
|
||||
Item = item;
|
||||
AncestorLookup = ancestorLookup;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user