public ICsiXmlElement RemoveChild(ICsiXmlElement child) { CsiXmlElement impl = (CsiXmlElement)child; this.mDOMElement.RemoveChild(impl.GetDomElement()); return(impl); }
public ICsiRevisionedObject GetItemByRef(string itemName, string revision, bool useROR) { foreach (object allChild in this.GetAllChildren()) { CsiXmlElement csiXmlElementImpl = allChild as CsiXmlElement; if (!(csiXmlElementImpl.FindChildByName("__name") is CsiXmlElement childByName1) || !itemName.Equals(CsiXmlHelper.GetFirstTextNodeValue(childByName1))) { continue; } if (!(csiXmlElementImpl.FindChildByName("__useROR") is CsiXmlElement childByName2) || XmlConvert.ToBoolean(CsiXmlHelper.GetFirstTextNodeValue(childByName2)) != useROR) { continue; } if (useROR || Util.StringUtil.IsEmptyString(revision)) { return((ICsiRevisionedObject) new CsiRevisionedObject(this.GetOwnerDocument(), csiXmlElementImpl.GetDomElement())); } if (!(csiXmlElementImpl.FindChildByName("__rev") is CsiXmlElement childByName3) || !revision.Equals(CsiXmlHelper.GetFirstTextNodeValue(childByName3))) { continue; } return((ICsiRevisionedObject) new CsiRevisionedObject(this.GetOwnerDocument(), csiXmlElementImpl.GetDomElement())); } return(null); }
public ICsiXmlElement AppendChild(ICsiXmlElement child) { CsiXmlElement impl = (CsiXmlElement)child; try { if (this.mDOMElement.OwnerDocument == impl.GetDomElement().OwnerDocument) { this.mDOMElement.AppendChild(impl.GetDomElement()); } } catch (Exception exception) { throw new Exceptions.CsiClientException(-1L, exception, base.GetType().FullName + ".appendChild()"); } return(child); }
public ICsiSubentity GetItemByIndex(int index) { CsiXmlElement csiXmlElementImpl = this.GetItem(index); if (csiXmlElementImpl == null) { return((ICsiSubentity)null); } return((ICsiSubentity) new CsiSubentity(this.GetOwnerDocument(), csiXmlElementImpl.GetDomElement())); }
public ICsiNamedObject GetItemByName(string name) { CsiXmlElement impl = this.GetItem(name); if (impl == null) { return(null); } return(new CsiNamedObject(this.GetOwnerDocument(), impl.GetDomElement())); }
public ICsiNamedObject GetItemByIndex(int index) { CsiXmlElement impl = this.GetItem(index); if (impl == null) { return(null); } return(new CsiNamedObject(this.GetOwnerDocument(), impl.GetDomElement())); }
public ICsiDataField GetItemByIndex(int index) { CsiXmlElement impl = this.GetItem(index); if (impl == null) { return(null); } return(new CsiDataField(this.GetOwnerDocument(), impl.GetDomElement())); }
public virtual long GetCount() { long num = 0L; IEnumerator enumerator = this.GetAllChildren().GetEnumerator(); while (enumerator.MoveNext()) { CsiXmlElement current = enumerator.Current as CsiXmlElement; if (current.GetDomElement().NodeType == XmlNodeType.Element) { num += 1L; } } return(num); }
public static string GetFirstTextNodeValue(CsiXmlElement csiElement) { string str = string.Empty; if (csiElement != null) { for (XmlNode node = csiElement.GetDomElement().FirstChild; node != null; node = node.NextSibling) { if ((node.NodeType == XmlNodeType.Text) || (node.NodeType == XmlNodeType.CDATA)) { str = node.Value; } } } return(str); }
protected ICsiRequestField RequestForField(string fieldName) { CsiRequestField child = null; string[] stringList = StringUtil.GetStringList(fieldName, '.'); CsiXmlElement parent = this; for (int i = 0; i < stringList.Length; i++) { XmlElement requestField = this.GetElement(parent.GetDomElement(), stringList[i]); if (requestField != null) { child = new CsiRequestField(this.GetOwnerDocument(), requestField); } else { child = new CsiRequestField(this.GetOwnerDocument(), stringList[i], parent); parent.AppendChild(child); } parent = child; } return(child); }
public ICsiRevisionedObject GetItemByIndex(int index) { CsiXmlElement csiXmlElementImpl = this.GetItem(index); if (csiXmlElementImpl == null) { return((ICsiRevisionedObject)null); } return((ICsiRevisionedObject) new CsiRevisionedObject(this.GetOwnerDocument(), csiXmlElementImpl.GetDomElement())); }
public ICsiNamedSubentity GetItemByName(string name) { CsiXmlElement csiXmlElementImpl = this.GetItem(name); if (csiXmlElementImpl == null) { return((ICsiNamedSubentity)null); } return((ICsiNamedSubentity) new CsiNamedSubentity(this.GetOwnerDocument(), csiXmlElementImpl.GetDomElement())); }