public static PhysicsInertiaData FromXml2(string text) { if (text == String.Empty) { return(null); } bool error; PhysicsInertiaData v; UTF8Encoding enc = new UTF8Encoding(); using (MemoryStream ms = new MemoryStream(enc.GetBytes(text))) using (XmlTextReader xreader = new XmlTextReader(ms)) { xreader.ProhibitDtd = true; v = new PhysicsInertiaData(); v.FromXml2(xreader, out error); } if (error) { return(null); } return(v); }
public static PhysicsInertiaData FromXml2(string text) { if (text == String.Empty) { return(null); } UTF8Encoding enc = new UTF8Encoding(); MemoryStream ms = new MemoryStream(enc.GetBytes(text)); XmlTextReader xreader = new XmlTextReader(ms); PhysicsInertiaData v = new PhysicsInertiaData(); bool error; v.FromXml2(xreader, out error); xreader.Close(); if (error) { return(null); } return(v); }
public static PhysicsInertiaData FromXml2(XmlReader reader) { PhysicsInertiaData data = new PhysicsInertiaData(); bool errors = false; data.FromXml2(reader, out errors); if (errors) { return(null); } return(data); }