Esempio n. 1
0
 public void SaveProject(Project project)
 {
     var serializer = new XmlSerializer(typeof (Project));
     using (TextWriter writer = new StreamWriter(GetAppDataProjectFilePath()))
     {
         serializer.Serialize(writer, project);
     }
 }
Esempio n. 2
0
 public Project LoadProject()
 {
     if (File.Exists(GetAppDataProjectFilePath()))
     {
         using (TextReader reader = new StreamReader(GetAppDataProjectFilePath()))
         {
             var deserializer = new XmlSerializer(typeof (Project));
             var obj = deserializer.Deserialize(reader);
             _project = obj as Project;
             return _project;
         }
     }
     _project = new Project();
     return _project;
 }