public IXmlDocumentElement SelectSingleNode(string nodePathToReturn) { XmlElement folder = this.NavigateToPath(nodePathToReturn); var node = new XmlDocumentElement(); node.HasChildNodes = folder.HasChildNodes; node.NameAttribute = folder.GetAttribute(NODE_NAME_ATTRIBUTE); node.CurrentPath = nodePathToReturn; node.ElementType = folder.Name; return node; }
async public Task<IXmlDocumentElement> GetRootChildAsync(string filePath) { await this.EnsureDocumentIsReadyAsync(filePath); XmlNode root = this.doc.FirstChild; var element = new XmlDocumentElement() { ElementType = root.Name, NameAttribute = ((XmlElement)root).GetAttribute(NODE_NAME_ATTRIBUTE), CurrentPath = @"\", HasChildNodes = root.HasChildNodes }; return element; }