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 virtual string GetLevel() { CsiXmlElement impl = base.FindChildByName("__level") as CsiXmlElement; string str = string.Empty; if (impl != null) { CsiXmlElement csiElement = (CsiXmlElement)impl.FindChildByName("__name"); if (csiElement != null) { str = CsiXmlHelper.GetFirstTextNodeValue(csiElement); } } return(str); }
protected virtual CsiXmlElement GetItem(string name) { IEnumerator enumerator = this.GetListItems().GetEnumerator(); while (enumerator.MoveNext()) { CsiXmlElement current = (CsiXmlElement)enumerator.Current; CsiXmlElement impl2 = (CsiXmlElement)current.FindChildByName("__name"); if ((impl2 != null) && name.Equals(impl2.GetElementValue())) { return(current); } } return(null); }