/// <summary> /// Returns the xml node which corresponds to the Order By tag. /// If this node does not exist, creates a new one (if needed). /// </summary> private XmlNode GetOrderByTagXmlNode(bool createNew) { XmlNode myOrderByNode = ParsedDocument.SelectSingleNode(string.Format(@"{0}/{1}[@{2}='{3}']", cRootXmlNodeName, cTagXmlNodeName, cTagTypeXmlAttributeName, OrderByTag.cTagName)); if (myOrderByNode == null && createNew) { var myOrderByTag = new OrderByTag(); myOrderByTag.InitializeFromData(this, null, false); myOrderByNode = CreateTagXmlNode(myOrderByTag); XmlNode myForUpdateNode = GetForUpdateTagXmlNode(); if (myForUpdateNode != null) { myForUpdateNode.ParentNode.InsertBefore(myOrderByNode, myForUpdateNode); return(myOrderByNode); } XmlNode myFromNode = GetFromTagXmlNode(); myFromNode.ParentNode.AppendChild(myOrderByNode); } return(myOrderByNode); }
/// <summary> /// Returns the xml node which corresponds to the Order By tag. /// If this node does not exist, creates a new one (if needed). /// </summary> private XmlNode GetOrderByTagXmlNode(bool createNew) { XmlNode myOrderByNode = ParsedDocument.SelectSingleNode(string.Format(@"{0}/{1}[@{2}='{3}']", cRootXmlNodeName, cTagXmlNodeName, cTagTypeXmlAttributeName, OrderByTag.cTagName)); if (myOrderByNode == null && createNew) { OrderByTag myOrderByTag = new OrderByTag(); myOrderByTag.InitializeFromData(this, null, false); myOrderByNode = CreateTagXmlNode(myOrderByTag); XmlNode myForUpdateNode = GetForUpdateTagXmlNode(); if (myForUpdateNode != null) { myForUpdateNode.ParentNode.InsertBefore(myOrderByNode, myForUpdateNode); return myOrderByNode; } XmlNode myFromNode = GetFromTagXmlNode(); myFromNode.ParentNode.AppendChild(myOrderByNode); } return myOrderByNode; }