public static FacilityType ReadXml(string cobieModelFileName) { var x = FacilityType.GetSerializer(); var reader = new XmlTextReader(cobieModelFileName); var reqFacility = (FacilityType)x.Deserialize(reader); reader.Close(); return(reqFacility); }
public static void WriteXml(TextWriter textWriter, FacilityType theFacility) { var namespaces = new XmlSerializerNamespaces(new[] { new XmlQualifiedName("cobielite", "http://docs.buildingsmartalliance.org/nbims03/cobie/cobielite"), new XmlQualifiedName("core", "http://docs.buildingsmartalliance.org/nbims03/cobie/core"), new XmlQualifiedName("xsi", "http://www.w3.org/2001/XMLSchema-instance") }); var x = FacilityType.GetSerializer(); using (var xtw = new XbimCoBieLiteXmlWriter(textWriter)) { xtw.Formatting = Formatting.Indented; // Now serialize our object. x.Serialize(xtw, theFacility, namespaces); } }