示例#1
0
        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();
        }
示例#2
0
        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();
        }
示例#3
0
        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));
                }
            }
        }
示例#4
0
        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;
 }
示例#6
0
 internal void RemoveInternal(NotebookPage page)
 {
     base.Remove(page);
 }
示例#7
0
 internal void AddInternal(NotebookPage page)
 {
     base.Add(page);
 }