private DockableControlPane CreatePane(Control smartPart, UltraDockSmartPartInfo smartPartInfo) { // create a pane to represent the smart part control DockableControlPane pane = new DockableControlPane(Guid.NewGuid().ToString(), smartPart); // keep track of the smart part to pane key relationship this.composer.Add(pane.Key, smartPart); // apply the smart part info this.ApplySmartPartInfoHelper(pane, smartPartInfo); // find out where this should be if we don't have a group DockedLocation location = smartPartInfo.DefaultLocation; // get the default pane style ChildPaneStyle paneStyle = smartPartInfo.DefaultPaneStyle; // store the key of the new groups string preferredGroupKey = smartPartInfo.PreferredGroup; // see if the group that this would like to belong to exists DockableGroupPane groupPane = this.FindGroup(preferredGroupKey); if (groupPane == null) { // create a dock area that should house the control pane DockAreaPane newDockArea = new DockAreaPane(location); newDockArea.Key = preferredGroupKey; newDockArea.ChildPaneStyle = paneStyle; Size paneSize = smartPartInfo.PreferredSize == Size.Empty ? smartPart.Size : smartPartInfo.PreferredSize; switch (location) { case DockedLocation.DockedLeft: case DockedLocation.DockedRight: paneSize.Width += this.SplitterBarWidth; break; case DockedLocation.DockedTop: case DockedLocation.DockedBottom: paneSize.Height += this.SplitterBarWidth; break; } newDockArea.Size = paneSize; newDockArea.Panes.Add(pane); this.DockAreas.Add(newDockArea); } else // just add it to the group that already exists { groupPane.Panes.Add(pane); } return(pane); }
public UltraDockSmartPartInfo(string title, string description, DockedLocation defaultLocation, ChildPaneStyle defaultPaneStyle, string preferredGroup) : this(title, description, defaultLocation, defaultPaneStyle) { this.preferredGroup = preferredGroup; }
public UltraDockSmartPartInfo(string title, string description, DockedLocation defaultLocation, ChildPaneStyle defaultPaneStyle) : this(title, description, defaultLocation) { this.defaultPaneStyle = defaultPaneStyle; }