void UpdateTabstrip()
        {
            var hadSplit = hasSplit;

            var hasMultipleViews = currentContainer != null && currentContainer.GetAllViews().Skip(1).Any();

            tabstrip.Visible = hasMultipleViews && (supportedModes & DocumentViewContainerMode.Tabs) != 0;

            hasSplit = (this.supportedModes & DocumentViewContainerMode.VerticalSplit) != 0 || (this.supportedModes & DocumentViewContainerMode.HorizontalSplit) != 0;
            if (hasSplit && !hadSplit)
            {
                var currentActive = tabstrip.ActiveTab;
                var tab           = new Tab(tabstrip, GettextCatalog.GetString("Split"));
                tabstrip.AddTab(tab);
                tabstrip.ActiveTab = currentActive;
                tab.Activated     += TabActivated;
            }
            else if (!hasSplit && hadSplit)
            {
                tabstrip.RemoveTab(tabstrip.TabCount - 1);
            }

            // If this container is showing tabs and it is inside another container, give the parent the
            // chance to show the tabstrip in its own tab area, to avoid tab stacking
            ParentContainer?.UpdateAttachedTabstrips();

            // This might be a container that has children with tabs. Maybe now it is possible to embed the
            // child tabstrips into this container's tab area. Let's try!
            UpdateAttachedTabstrips();
        }
Esempio n. 2
0
 public void RemoveAllViews()
 {
     while (tabstrip.Tabs.Count > 0)
     {
         tabstrip.RemoveTab(0);
     }
     ShowActiveContent();
 }
Esempio n. 3
0
        void UpdateTabstrip()
        {
            var hadSplit = hasSplit;

            var hasMultipleViews = currentContainer != null && currentContainer.GetAllViews().Skip(1).Any();

            tabstrip.Visible = hasMultipleViews && (supportedModes & DocumentViewContainerMode.Tabs) != 0;

            hasSplit = (this.supportedModes & DocumentViewContainerMode.VerticalSplit) != 0 || (this.supportedModes & DocumentViewContainerMode.HorizontalSplit) != 0;
            if (hasSplit && !hadSplit)
            {
                var currentActive = tabstrip.ActiveTab;
                var tab           = new Tab(tabstrip, GettextCatalog.GetString("Split"));
                tabstrip.AddTab(tab);
                tabstrip.ActiveTab = currentActive;
                tab.Activated     += TabActivated;
            }
            else if (!hasSplit && hadSplit)
            {
                tabstrip.RemoveTab(tabstrip.TabCount - 1);
            }
        }