Exemplo n.º 1
0
 public static OutlineDocumentViewModel Read(string path)
 {
     using (StreamReader file = File.OpenText(path))
     {
         JsonSerializer           serializer = new JsonSerializer();
         OutlineDocumentViewModel doc        = (OutlineDocumentViewModel)serializer.Deserialize(file, typeof(OutlineDocumentViewModel));
         doc.RefreshParentalReferences();
         doc.SavePath(path);
         return(doc);
     }
 }
Exemplo n.º 2
0
 public static void Write(OutlineDocumentViewModel outline, string path)
 {
     File.WriteAllText(path, JsonConvert.SerializeObject(outline));
     outline.SavePath(path);
 }