Esempio n. 1
0
        private void SetSelected(TabPanel tabPanel)
        {
            tabPanel.SuspendLayout();
            bool flag          = !tabPanel.Visible;
            bool containsFocus = this.ContainsFocus;

            tabPanel.Visible = true;
            if (flag && containsFocus)
            {
                tabPanel.Focus();
            }
            tabPanel.Bounds = this.TabPanelBounds;
            this.SelectTabItem(tabPanel.TabStripItem);
            tabPanel.ResumeLayout();
            if (!this.DesignMode)
            {
                return;
            }
            if (!flag)
            {
                return;
            }
            try
            {
                (this.GetService(typeof(ISelectionService)) as ISelectionService)?.SetSelectedComponents((ICollection) new Component[1]
                {
                    (Component)tabPanel
                }, SelectionTypes.Replace);
                (this.GetService(typeof(IComponentChangeService)) as IComponentChangeService)?.OnComponentChanged((object)this, (MemberDescriptor)null, (object)null, (object)null);
            }
            catch
            {
            }
        }
Esempio n. 2
0
        private void SetSelected(TabPanel tabPanel)
        {
            tabPanel.SuspendLayout();

            bool selectionChange = !tabPanel.Visible;
            bool focused         = this.ContainsFocus;

            tabPanel.Visible = true;
            if (selectionChange && focused)
            {
                tabPanel.Focus();
            }

            tabPanel.Bounds = this.TabPanelBounds;
            SelectTabItem(tabPanel.TabStripItem);

            tabPanel.ResumeLayout();

            if (!this.DesignMode || !selectionChange)
            {
                return;
            }

            ISelectionService selService = this.GetService(typeof(ISelectionService)) as ISelectionService;

            if (selService != null)
            {
                selService.SetSelectedComponents(new Component[] { tabPanel }, SelectionTypes.Replace);
            }
            IComponentChangeService changeService = this.GetService(typeof(IComponentChangeService)) as IComponentChangeService;

            if (changeService != null)
            {
                changeService.OnComponentChanged(this, null, null, null);
            }
        }