Exemple #1
0
        private void OnAddPanel(object sender, EventArgs e)
        {
            Control.ControlCollection oldManagedPanels = HostControl.Controls;

            RaiseComponentChanging(TypeDescriptor.GetProperties(HostControl)["ManagedPanels"]);

            ManagedPanel P = (ManagedPanel)DesignerHost.CreateComponent(typeof(ManagedPanel));

            P.Text = P.Name;
            HostControl.ManagedPanels.Add(P);

            RaiseComponentChanged(TypeDescriptor.GetProperties(HostControl)["ManagedPanels"], oldManagedPanels, HostControl.ManagedPanels);
            HostControl.SelectedPanel = P;

            SetVerbs();
        }
Exemple #2
0
        protected virtual void OnSelectedPanelChanged(EventArgs e)
        {
            lock (static_OnSelectedPanelChanged_oldSelection_Init)
            {
                try
                {
                    if (InitStaticVariableHelper(static_OnSelectedPanelChanged_oldSelection_Init))
                    {
                        static_OnSelectedPanelChanged_oldSelection = null;
                    }
                }
                finally
                {
                    static_OnSelectedPanelChanged_oldSelection_Init.State = 1;
                }
            }
            if ((static_OnSelectedPanelChanged_oldSelection != null))
            {
                static_OnSelectedPanelChanged_oldSelection.Visible = false;
            }
            if ((m_SelectedPanel != null))
            {
                ((ManagedPanel)m_SelectedPanel).Visible = true;
            }
            bool tabChanged = false;

            if (m_SelectedPanel == null)
            {
                tabChanged = (static_OnSelectedPanelChanged_oldSelection != null);
            }
            else
            {
                tabChanged = !(m_SelectedPanel.Equals(static_OnSelectedPanelChanged_oldSelection));
            }
            if (tabChanged & this.Created)
            {
                if (SelectedIndexChanged != null)
                {
                    SelectedIndexChanged(this, EventArgs.Empty);
                }
            }
            static_OnSelectedPanelChanged_oldSelection = (ManagedPanel)m_SelectedPanel;
        }