private void OnDockspaceSeparatorMoved(object sender, SplitterEventArgs e) { // Cast to correct type and grab associated dockspace element KryptonDockspaceSeparator separatorControl = (KryptonDockspaceSeparator)sender; KryptonDockingDockspace dockspaceElement = _lookupSeparator[separatorControl]; // Update with delta change switch (Edge) { case DockingEdge.Left: dockspaceElement.DockspaceControl.Width += e.SplitX; break; case DockingEdge.Right: dockspaceElement.DockspaceControl.Width -= e.SplitX; break; case DockingEdge.Top: dockspaceElement.DockspaceControl.Height += e.SplitY; break; case DockingEdge.Bottom: dockspaceElement.DockspaceControl.Height -= e.SplitY; break; } if (_update) { // Inform our owning control that the update has ended, allowing the client area to be drawn KryptonDockingControl c = GetParentType(typeof(KryptonDockingControl)) as KryptonDockingControl; c.PropogateAction(DockingPropogateAction.EndUpdate, (string[])null); _update = false; } }
private void OnDockspaceSeparatorNotMoved(object sender, EventArgs e) { if (_update) { // Inform our owning control that the update has ended, allowing the client area to be drawn KryptonDockingControl c = GetParentType(typeof(KryptonDockingControl)) as KryptonDockingControl; c.PropogateAction(DockingPropogateAction.EndUpdate, (string[])null); _update = false; } }
/// <summary> /// Initialize a new instance of the DragTargetControlEdge class. /// </summary> /// <param name="screenRect">Rectangle for screen area.</param> /// <param name="hotRect">Rectangle for hot area.</param> /// <param name="drawRect">Rectangle for draw area.</param> /// <param name="hint">Target hint which should be one of the edges.</param> /// <param name="controlElement">Workspace instance that contains cell.</param> /// <param name="allowFlags">Only drop pages that have one of these flags defined.</param> /// <param name="outsideEdge">Add to the outside edge (otherwise the inner edge).</param> public DragTargetControlEdge(Rectangle screenRect, Rectangle hotRect, Rectangle drawRect, DragTargetHint hint, KryptonDockingControl controlElement, KryptonPageFlags allowFlags, bool outsideEdge) : base(screenRect, hotRect, drawRect, hint, allowFlags) { ControlElement = controlElement; _outsideEdge = outsideEdge; // Find the orientation by looking for a matching hint (we need to exclude flags from the hint enum) switch (hint & DragTargetHint.ExcludeFlags) { case DragTargetHint.Transfer: case DragTargetHint.EdgeLeft: Edge = VisualOrientation.Left; break; case DragTargetHint.EdgeRight: Edge = VisualOrientation.Right; break; case DragTargetHint.EdgeTop: Edge = VisualOrientation.Top; break; case DragTargetHint.EdgeBottom: Edge = VisualOrientation.Bottom; break; default: Debug.Assert(false); throw new ArgumentOutOfRangeException("Hint must be an edge value."); } }