internal string StringSerialize(UserEditable UserEditable) { TextWriter w = WriterSerialize(UserEditable); string xml = w.ToString(); w.Close(); return(xml.Trim()); }
private TextWriter WriterSerialize(UserEditable UserEditable) { TextWriter w = new StringWriter(); this.s = new XmlSerializer(this.type); s.Serialize(w, UserEditable); w.Flush(); return(w); }
internal XmlDocument Serialize(UserEditable UserEditable) { string xml = StringSerialize(UserEditable); XmlDocument doc = new XmlDocument(); doc.PreserveWhitespace = true; doc.LoadXml(xml); return(doc); }
internal UserEditable Deserialize(TextReader reader) { try { UserEditable o = (UserEditable)s.Deserialize(reader); reader.Close(); return(o); } catch (InvalidCastException) // changed setting from long to int { return(new UserEditable()); } }
internal static bool WriteFile(string file, UserEditable config) { bool ok = false; ConfigSerializer serializer = new ConfigSerializer(); try { string xml = serializer.Serialize(config).OuterXml; using (StreamWriter writer = new StreamWriter(file, false)) { writer.Write(xml.Trim()); writer.Flush(); writer.Close(); } ok = true; } catch { } return ok; }
internal static bool WriteFile(string file, UserEditable config) { bool ok = false; ConfigSerializer serializer = new ConfigSerializer(); try { string xml = serializer.Serialize(config).OuterXml; using (StreamWriter writer = new StreamWriter(file, false)) { writer.Write(xml.Trim()); writer.Flush(); writer.Close(); } ok = true; } catch { } return(ok); }
internal string StringSerialize(UserEditable UserEditable) { TextWriter w = WriterSerialize(UserEditable); string xml = w.ToString(); w.Close(); return xml.Trim(); }
internal XmlDocument Serialize(UserEditable UserEditable) { string xml = StringSerialize(UserEditable); XmlDocument doc = new XmlDocument(); doc.PreserveWhitespace = true; doc.LoadXml(xml); return doc; }
private TextWriter WriterSerialize(UserEditable UserEditable) { TextWriter w = new StringWriter(); this.s = new XmlSerializer(this.type); s.Serialize(w, UserEditable); w.Flush(); return w; }