Exemple #1
0
        public bool SaveAs(string path)
        {
            var data = DataContractSerializerHelper.ToString(this);

            File.WriteAllText(path, data);
            this.FilePath = path;
            return(true);
        }
Exemple #2
0
 public static Page Open(string path)
 {
     try
     {
         var data = File.ReadAllText(path);
         var page = DataContractSerializerHelper.ToObject <Page>(data);
         page.FilePath = path;
         return(page);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         return(null);
     }
 }