protected void OnSelectedPanelChanged(EventArgs e) { if (oldSelection != null) { oldSelection.Visible = false; } if (m_SelectedPanel != null) { (m_SelectedPanel).Visible = true; } bool tabChanged = false; if (m_SelectedPanel == null) { tabChanged = (oldSelection != null); } else { tabChanged = (!m_SelectedPanel.Equals(oldSelection)); } if (tabChanged && Created) { if (SelectedIndexChanged != null) { SelectedIndexChanged(this, EventArgs.Empty); } } oldSelection = m_SelectedPanel; }
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(); }
protected void OnSelectedPanelChanged(EventArgs e) { if (oldSelection != null) oldSelection.Visible = false; if (m_SelectedPanel != null) (m_SelectedPanel).Visible = true; bool tabChanged = false; if (m_SelectedPanel == null) tabChanged = (oldSelection != null); else tabChanged = (!m_SelectedPanel.Equals(oldSelection)); if (tabChanged && Created) if (SelectedIndexChanged != null) SelectedIndexChanged(this, EventArgs.Empty); oldSelection = m_SelectedPanel; }