/// <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."); } }
/// <summary> /// Initialize a new instance of the DragTargetWorkspaceEdge 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="workspace">Control instance for drop.</param> /// <param name="allowFlags">Only drop pages that have one of these flags defined.</param> public DragTargetWorkspaceEdge(Rectangle screenRect, Rectangle hotRect, Rectangle drawRect, DragTargetHint hint, KryptonWorkspace workspace, KryptonPageFlags allowFlags) : base(screenRect, hotRect, drawRect, hint, workspace, allowFlags) { // 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."); } }
/// <summary> /// Initialize a new instance of the DragTargetWorkspace 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="workspace">Control instance for drop.</param> /// <param name="allowFlags">Only drop pages that have one of these flags defined.</param> public DragTargetWorkspace(Rectangle screenRect, Rectangle hotRect, Rectangle drawRect, DragTargetHint hint, KryptonWorkspace workspace, KryptonPageFlags allowFlags) : base(screenRect, hotRect, drawRect, hint, allowFlags) { Workspace = workspace; }
/// <summary> /// Initialize a new instance of the DragTargetWorkspace 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="workspace">Control instance for drop.</param> /// <param name="allowFlags">Only drop pages that have one of these flags defined.</param> public DragTargetWorkspace(Rectangle screenRect, Rectangle hotRect, Rectangle drawRect, DragTargetHint hint, KryptonWorkspace workspace, KryptonPageFlags allowFlags) : base(screenRect, hotRect, drawRect, hint, allowFlags) { _workspace = workspace; }
/// <summary> /// Initialize a new instance of the DragTargetWorkspaceCellEdge 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="workspace">Workspace instance that contains cell.</param> /// <param name="cell">Workspace cell as target for drop.</param> /// <param name="allowFlags">Only drop pages that have one of these flags defined.</param> public DragTargetWorkspaceCellEdge(Rectangle screenRect, Rectangle hotRect, Rectangle drawRect, DragTargetHint hint, KryptonWorkspace workspace, KryptonWorkspaceCell cell, KryptonPageFlags allowFlags) : base(screenRect, hotRect, drawRect, hint, workspace, allowFlags) { Cell = cell; _visibleNotDraggedPages = -1; }
/// <summary> /// Initialize a new instance of the DragTarget class. /// </summary> /// <param name="screenRect">Rectangle representing targets screen area.</param> /// <param name="hotRect">Rectangle representing targets hot area.</param> /// <param name="drawRect">Rectangle representing targets drawing area.</param> /// <param name="hint">Hint about the targets operation.</param> /// <param name="allowFlags">Only drop pages that have one of these flags defined.</param> public DragTarget(Rectangle screenRect, Rectangle hotRect, Rectangle drawRect, DragTargetHint hint, KryptonPageFlags allowFlags) { _screenRect = screenRect; _hotRect = hotRect; _drawRect = drawRect; _hint = hint; _allowFlags = allowFlags; }
/// <summary> /// Initialize a new instance of the DragTarget class. /// </summary> /// <param name="screenRect">Rectangle representing targets screen area.</param> /// <param name="hotRect">Rectangle representing targets hot area.</param> /// <param name="drawRect">Rectangle representing targets drawing area.</param> /// <param name="hint">Hint about the targets operation.</param> /// <param name="allowFlags">Only drop pages that have one of these flags defined.</param> protected DragTarget(Rectangle screenRect, Rectangle hotRect, Rectangle drawRect, DragTargetHint hint, KryptonPageFlags allowFlags) { ScreenRect = screenRect; HotRect = hotRect; DrawRect = drawRect; Hint = hint; AllowFlags = allowFlags; }
/// <summary> /// Initialize a new instance of the DragTargetWorkspaceCellEdge 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="workspace">Workspace instance that contains cell.</param> /// <param name="cell">Workspace cell as target for drop.</param> /// <param name="allowFlags">Only drop pages that have one of these flags defined.</param> public DragTargetWorkspaceCellEdge(Rectangle screenRect, Rectangle hotRect, Rectangle drawRect, DragTargetHint hint, KryptonWorkspace workspace, KryptonWorkspaceCell cell, KryptonPageFlags allowFlags) : base(screenRect, hotRect, drawRect, hint, workspace, allowFlags) { _cell = cell; _visibleNotDraggedPages = -1; }
/// <summary> /// Add the new target to the cluster. /// </summary> /// <param name="target">Target to add into cluster.</param> public void Add(DragTarget target) { // Find the hint that excludes extra flags DragTargetHint hint = target.Hint & DragTargetHint.ExcludeFlags; // Can only add one of each hint value if (!_hintToTarget.ContainsKey(hint)) { _hintToTarget.Add(hint, target); // Make sure the drawing rectangle encloses all targets DrawRect = Rectangle.Union(DrawRect, target.DrawRect); } }
/// <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(nameof(hint), @"Hint must be an edge value."); } }