public bool SaveAs(string path) { var data = DataContractSerializerHelper.ToString(this); File.WriteAllText(path, data); this.FilePath = path; return(true); }
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); } }