public static XRootNamespace Parse(string text, LoadOptions options) { XRootNamespace root = new XRootNamespace(); root.doc = XDocument.Parse(text, options); XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); if ((typedRoot == null)) { throw new LinqToXsdException("Invalid root element in xml document."); } root.rootObject = typedRoot; return(root); }
public static XRootNamespace Load(XmlReader xmlReader) { XRootNamespace root = new XRootNamespace(); root.doc = XDocument.Load(xmlReader); XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); if ((typedRoot == null)) { throw new LinqToXsdException("Invalid root element in xml document."); } root.rootObject = typedRoot; return(root); }
public static XRoot Load(TextReader textReader, LoadOptions options) { XRoot root = new XRoot(); root.doc = XDocument.Load(textReader, options); XTypedElement typedRoot = XTypedServices.ToXTypedElement(root.doc.Root, LinqToXsdTypeManager.Instance); if ((typedRoot == null)) { throw new LinqToXsdException("Invalid root element in xml document."); } root.rootObject = typedRoot; return(root); }
public static XRootNamespace Load(TextReader textReader) { var root = new XRootNamespace { _doc = XDocument.Load(textReader) }; var typedRoot = XTypedServices.ToXTypedElement(root._doc.Root, LinqToXsdTypeManager.Instance); if ((typedRoot == null)) { throw new LinqToXsdException("Invalid root element in xml document."); } root._rootObject = typedRoot; return(root); }
public static XRoot Parse(string text, LoadOptions options) { var root = new XRoot { _xDocument = XDocument.Parse(text, options) }; var typedRoot = XTypedServices.ToXTypedElement(root._xDocument.Root, LinqToXsdTypeManager.Instance); if ((typedRoot == null)) { throw new LinqToXsdException("Invalid root element in xml document."); } root._rootObject = typedRoot; return(root); }
public static XRoot Load(XmlReader xmlReader) { var root = new XRoot { _xDocument = XDocument.Load(xmlReader) }; var typedRoot = XTypedServices.ToXTypedElement(root._xDocument.Root, LinqToXsdTypeManager.Instance); if ((typedRoot == null)) { throw new LinqToXsdException("Invalid root element in xml document."); } root._rootObject = typedRoot; return(root); }