Пример #1
0
 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);
     }
 }
Пример #2
0
 void KeyCreateNewNote(object sender, EventArgs args)
 {
     try {
         manager.GtkInvoke(() => {
             Note new_note = manager.Create();
             new_note.Window.Show();
         });
     } catch {
         // Fail silently.
     }
 }
Пример #3
0
 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();
     }
 }