/// <summary> /// Deserialises the version history from the specified xml element. /// </summary> internal static void Deserialise(Domain domain, XmlNode parentNode) { foreach (XmlNode xmlNode in parentNode.SelectNodes("table")) { DomainTable result = domain.CreateTable(); result.Deserialise(xmlNode); DomainTableColumn.Deserialise(result, xmlNode); DomainTableIndex.Deserialise(result, xmlNode); DomainTableConstraint.Deserialise(result, xmlNode); } }
/// <summary> /// Loads the domain from the specified document. /// </summary> public static Domain Load(String filePath) { Domain domain = new Domain(); if (File.Exists(filePath)) { XmlDocument document = new XmlDocument(); document.Load(filePath); domain._version = new Version(document.DocumentElement.Attributes["version"].Value); domain.Deserialise(document.DocumentElement); DomainTable.Deserialise(domain, document.DocumentElement); DomainContainer.Deserialise(domain, document.DocumentElement); DomainContainer.DeserialiseExtenders(domain, document.DocumentElement); DomainDataSource.Deserialise(domain, document.DocumentElement); } else { domain.ChangeVersion(7, 0, 0, 0, 0); domain.DomainName = "Consensus"; } return(domain); }