/// <summary> /// Shows the smart part in the workspace. /// </summary> /// <param name="smartPart">The smart part to show</param> /// <param name="smartPartInfo">The associated smart part info for the smart part being shown.</param> protected virtual void OnShow(Control smartPart, UltraMdiTabSmartPartInfo smartPartInfo) { // create and show the tab MdiTab tab = this.CreateTab(smartPart, smartPartInfo); tab.Show(); }
/// <summary> /// Activates the smart part within the workspace. /// </summary> /// <param name="smartPart">The smart part to activate</param> protected virtual void OnActivate(Control smartPart) { MdiTab tab = this.GetTab(smartPart); // AS 7/13/06 BR13877 // When a hidden tab is requesting to be activated, we need to // show the associated form. // tab.Show(); tab.Activate(); }
private MdiTab CreateTab(Control smartPart, UltraMdiTabSmartPartInfo smartPartInfo) { if (this.MdiParent == null) { throw new InvalidOperationException(Properties.Resources.MdiParentNotSet); } // create an mdi form Form form = new Form(); form.MdiParent = this.MdiParent; string groupKey = smartPartInfo.PreferredGroup; // get the tab associated with that form MdiTab tab = this.TabFromForm(form); this.composer.Add(tab, smartPart); // add the control to the form and make it fill the mdi child smartPart.Dock = DockStyle.Fill; form.Controls.Add(smartPart); this.ApplySmartPartInfoHelper(tab, smartPartInfo); if (groupKey != null) { // if there's a group key, we'll use a helper class to put // the tab into the specified group using (TabDisplayingHelper tabHelper = new TabDisplayingHelper(this, groupKey)) tab.Show(); } else { tab.Show(); } return(tab); }