private bool CheckSave() { ParseProject(); if (_last_save == Sjson.Encode(JsonSerializer.Save(_project))) { return(true); } NSAlert alert = new NSAlert(); alert.AddButton(@"Save"); alert.AddButton(@"Don't Save"); alert.AddButton(@"Cancel"); alert.MessageText = @"Do you want to save changes to this document before closing?"; alert.InformativeText = @"If you don't save, your changes will be lost."; alert.AlertStyle = NSAlertStyle.Informational; int result = alert.RunModal(); if (result == (int)NSAlertButtonReturn.First) { saveProject(null); return(_file != null); } else if (result == (int)NSAlertButtonReturn.Second) { return(true); } else { return(false); } }
private bool CheckSave() { ParseProject(); if (_last_save == Sjson.Encode(JsonSerializer.Save(_project))) { return(true); } saveProjectToolStripMenuItem_Click(null, null); return(true); }
private void MarkSave() { if (_file != null) { mainWindowController.Window.Title = "Header Hero - " + _file; } else { mainWindowController.Window.Title = "Header Hero"; } _last_save = Sjson.Encode(JsonSerializer.Save(_project)); }
private void MarkSave() { if (_file != null) { Text = "Header Hero - " + _file; } else { Text = "Header Hero"; } _last_save = Sjson.Encode(JsonSerializer.Save(_project)); }