protected void OnSelectNewNote(object sender, NoteArgs e) { NoteListDialog listDialog = new NoteListDialog(); if (sender is Gtk.Dialog) { listDialog.TransientFor = (Gtk.Window)sender; } else { listDialog.TransientFor = this; } listDialog.Database = _database; listDialog.Record = null; listDialog.Modal = true; int response = listDialog.Run(); if (response == (int)Gtk.ResponseType.Apply) { e.Note = listDialog.Note; } else if (response == (int)Gtk.ResponseType.Ok) { // Create new note GedcomNoteRecord note = new GedcomNoteRecord(_database); e.Note = note; } listDialog.Destroy(); }
protected virtual void OnListOfNotesAction_Activated (object sender, System.EventArgs e) { if (_currentView != null) { _currentView.SaveView(); } //NotesViewView.SaveView(); NoteListDialog listDialog = new NoteListDialog(); if (sender is Gtk.Dialog) { listDialog.TransientFor = (Gtk.Window)sender; } else { listDialog.TransientFor = this; } listDialog.Database = _database; listDialog.Record = _record; listDialog.Show(); listDialog.Response += new Gtk.ResponseHandler(OnListNotes_Response); }