private void InsertPageInternal(int index, NotebookPage page) { if (page == null) { throw new NullReferenceException(); } if (NotebookPages.Contains(page)) { throw new ArgumentException(); } NotebookPages.InsertInternal(index, page); NoteControls.AddInternal(page); NavigatorInterface.RefreshAllPages(); }
private void AddPageInternal(NotebookPage page) { if (page == null) { throw new ArgumentException("Page cannot be null."); } if (NotebookPages.Contains(page)) { throw new ArgumentException("Page is already in the notebook."); } NotebookPages.AddInternal(page); NoteControls.AddInternal(page); NavigatorInterface.RefreshAllPages(); }
internal void OnCloseTab(NotebookPage page) { ClosePageQueryEventArgs args = new ClosePageQueryEventArgs(page); if (ClosePageQuery != null) { ClosePageQuery(this, args); } if (args.Cancel == false) { RemovePageInternal(page); if (ClosePage != null) { ClosePage(this, new ClosePageEventArgs(page)); } } }
private void RemovePageInternal(NotebookPage page) { if (page == null) { throw new NullReferenceException(); } int newIndex = SelectedIndex; if (newIndex >= NotebookPages.IndexOf(page) && newIndex > -1) { newIndex--; if (newIndex < 0 && NotebookPages.Count > 1) { newIndex = 0; } } if (newIndex >= NotebookPages.Count) { newIndex = NotebookPages.Count - 1; } SelectedIndex = newIndex; NotebookPages.RemoveInternal(page); NoteControls.RemoveInternal(page); if (NotebookPages.Count > 0 && SelectedIndex == -1) { SelectedIndex = 0; } NavigatorInterface.RefreshAllPages(); DisplayCorrectPage(); }
internal ClosePageQueryEventArgs(NotebookPage page) { mPage = page; }
internal void RemoveInternal(NotebookPage page) { base.Remove(page); }
internal void AddInternal(NotebookPage page) { base.Add(page); }