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

            if (index != -1)
            {
                Select(index);
            }
        }
コード例 #2
0
        public void RemoveTab(DocumentTab tab)
        {
            int index = tabs.IndexOf(tab);

            if (index != -1)
            {
                RemoveTab(index);
            }
        }
コード例 #3
0
ファイル: DocumentViewer.cs プロジェクト: dotfornet/dnSPy
 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
ファイル: DocumentViewer.cs プロジェクト: weimingtom/dnSpy
 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
ファイル: SaveAction.cs プロジェクト: slagusev/whiskey2d
 public SaveAction(DocumentTab tab)
     : base("Save", AssetManager.ICON_SAVE)
 {
     this.tab = tab;
 }
コード例 #9
0
ファイル: DocumentTabTests.cs プロジェクト: nopara73/Dock
        public void DocumentTab_Ctor()
        {
            var actual = new DocumentTab();

            Assert.NotNull(actual);
        }