Example #1
0
        private string serialize(LSSettings.LSMeta lsm)
        {
            var cfg = new System.Xml.XmlWriterSettings();
            cfg.NamespaceHandling = System.Xml.NamespaceHandling.OmitDuplicates;
            cfg.NewLineHandling = System.Xml.NewLineHandling.None;
            cfg.NewLineOnAttributes = false;
            cfg.OmitXmlDeclaration = true;
            cfg.Indent = false;

            var sb = new StringBuilder();
            var x = new System.Xml.Serialization.XmlSerializer(lsm.GetType());
            var w = System.Xml.XmlWriter.Create(sb, cfg);
            x.Serialize(w, lsm);
            w.Flush();
            w.Close();
            return sb.ToString();
        }