Пример #1
0
        public static string GetXML(Dictionary<int, ClientNode> nodeList)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(ClientNodes));

            StringWriter sw = new StringWriter();

            ClientNodes saver = new ClientNodes(nodeList);
            serializer.Serialize(sw, saver);

            return sw.ToString();
        }
Пример #2
0
        public static void Save(Dictionary<int, ClientNode> nodeList, string filename)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(ClientNodes));
            StreamWriter sw = new StreamWriter(filename);
            ClientNodes saver = new ClientNodes(nodeList);
            serializer.Serialize(sw, saver);

            sw.Close();
        }