示例#1
0
        public void Select(DocumentTab tab)
        {
            int index = tabs.IndexOf(tab);

            if (index != -1)
            {
                Select(index);
            }
        }
        public void RemoveTab(DocumentTab tab)
        {
            int index = tabs.IndexOf(tab);

            if (index != -1)
            {
                RemoveTab(index);
            }
        }
示例#3
0
 void IDocumentViewerHelper.SetFocus()
 {
     Debug.Assert(!isDisposed);
     if (isDisposed)
     {
         return;
     }
     DocumentTab.TrySetFocus();
 }
示例#4
0
 private void AddTab()
 {
     current_tab                  = new DocumentTab(nb_tabs);
     current_manager              = current_tab.Buffer.Undoer;
     current_manager.UndoChanged += UndoChanged;
     nb_tabs.AppendPage(current_tab, current_tab.TabLabel);
     nb_tabs.ShowTabs = (nb_tabs.NPages > 1);
     nb_tabs.ShowAll();
     nb_tabs.CurrentPage = nb_tabs.PageNum(current_tab);
     nb_tabs.SwitchPage += new SwitchPageHandler(OnChangeTab);
 }
示例#5
0
        public void AddTab(DocumentTab tab, bool select)
        {
            tabs.Add(tab);

            if (select)
            {
                selectedIndex = tabs.Count - 1;
                SelectedTabChanged?.Invoke(this, new EventArgs());
            }

            Invalidate();
        }
示例#6
0
 void IDocumentViewerHelper.FollowReference(TextReference textRef, bool newTab)
 {
     Debug.Assert(!isDisposed);
     if (isDisposed)
     {
         return;
     }
     Debug.Assert(DocumentTab != null);
     if (DocumentTab == null)
     {
         return;
     }
     DocumentTab.FollowReference(textRef, newTab);
 }
示例#7
0
        public void InsertTab(int index, DocumentTab tab, bool select)
        {
            if (index < 0 || index > tabs.Count)
            {
                throw new ArgumentOutOfRangeException(nameof(index), index, "Index must be within the bounds of " + nameof(Tabs));
            }

            tabs.Insert(index, tab);

            if (select)
            {
                selectedIndex = index;
                SelectedTabChanged?.Invoke(this, new EventArgs());
            }

            Invalidate();
        }
示例#8
0
 public SaveAction(DocumentTab tab)
     : base("Save", AssetManager.ICON_SAVE)
 {
     this.tab = tab;
 }
示例#9
0
        public void DocumentTab_Ctor()
        {
            var actual = new DocumentTab();

            Assert.NotNull(actual);
        }