示例#1
0
        public RepositoryNode ReadData(string filePath)
        {
            XmlSerializer  serializer = new XmlSerializer(typeof(RepositoryNode));
            FileStream     fs         = new FileStream(filePath, FileMode.Open);
            RepositoryNode node       = (RepositoryNode)serializer.Deserialize(fs);

            return(node);
        }
示例#2
0
        public void WriteData(RepositoryNode parentNode, string filePath)
        {
            XmlSerializer serializer = new XmlSerializer(typeof(RepositoryNode));
            TextWriter    tw         = new StreamWriter(filePath);

            //XmlWriter writer = XmlWriter.Create(filePath);
            serializer.Serialize(tw, parentNode);
            tw.Close();
        }