public string CreateNote() { if (note_manager.ReadOnly) { return(string.Empty); } try { Note note = note_manager.Create(); note.QueueSave(ChangeType.ContentChanged); return(note.Uri); } catch { return(string.Empty); } }
void KeyCreateNewNote(object sender, EventArgs args) { try { manager.GtkInvoke(() => { Note new_note = manager.Create(); new_note.Window.Show(); }); } catch { // Fail silently. } }
static void OnNewNoteAction(object sender, EventArgs args) { try { Note new_note = manager.Create(); new_note.Window.Show(); } catch (Exception e) { HIGMessageDialog dialog = new HIGMessageDialog( null, 0, Gtk.MessageType.Error, Gtk.ButtonsType.Ok, Catalog.GetString("Cannot create new note"), e.Message); dialog.Run(); dialog.Destroy(); } }