partial void EditNotebook (NSObject sender) { if (_notebooksTableView.SelectedRow == 0) { NSAlert alert = new NSAlert () { MessageText = "Notebook Cannot Be Edited", InformativeText = "You cannot edit 'All Notebooks' selection.", AlertStyle = NSAlertStyle.Warning }; alert.AddButton ("OK"); alert.BeginSheet (this.Window, this, null, IntPtr.Zero); } else { notebookEditPrompt = new NotebookEditPromptController (); notebookEditPrompt.Window.MakeKeyAndOrderFront (this); } }
void HandleNotebookDoubleClick (object sender, EventArgs e) { if (e == null) throw new ArgumentNullException("e"); if (sender == null) throw new ArgumentNullException("sender"); if (_notebooksTableView.SelectedRow == 0) { NSAlert alert = new NSAlert () { MessageText = "Notebook Cannot Be Edited", InformativeText = "You cannot edit 'All Notebooks' selection.", AlertStyle = NSAlertStyle.Warning }; alert.AddButton ("OK"); alert.BeginSheet (this.Window, this, null, IntPtr.Zero); } else if (_notebooksTableView.SelectedRow == -1) { //The empty region is double clicked, hence do nothing return; } else { notebookEditPrompt = new NotebookEditPromptController (); notebookEditPrompt.Window.MakeKeyAndOrderFront (this); } }