Пример #1
0
        /// <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(nameof(hint), @"Hint must be an edge value.");
            }
        }
        /// <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.");
            }
        }
Пример #3
0
        /// <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.");
            }
        }
Пример #4
0
 /// <summary>
 /// Initialize a new instance of the DragTargetNavigatorTransfer class.
 /// </summary>
 /// <param name="rect">Rectangle for hot and draw areas.</param>
 /// <param name="navigator">Control instance for drop.</param>
 /// <param name="allowFlags">Only drop pages that have one of these flags defined.</param>
 public DragTargetNavigatorTransfer(Rectangle rect,
                                    KryptonNavigator navigator,
                                    KryptonPageFlags allowFlags)
     : base(rect, rect, rect, DragTargetHint.Transfer, allowFlags)
 {
     _navigator = navigator;
     _notDraggedPagesFromNavigator = -1;
 }
 /// <summary>
 /// Initialize a new instance of the DragTargetNavigatorTransfer class.
 /// </summary>
 /// <param name="rect">Rectangle for hot and draw areas.</param>
 /// <param name="navigator">Control instance for drop.</param>
 /// <param name="allowFlags">Only drop pages that have one of these flags defined.</param>
 public DragTargetNavigatorTransfer(Rectangle rect,
                                    KryptonNavigator navigator,
                                    KryptonPageFlags allowFlags)
     : base(rect, rect, rect, DragTargetHint.Transfer, allowFlags)
 {
     _navigator = navigator;
     _notDraggedPagesFromNavigator = -1;
 }
Пример #6
0
 /// <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 DragTargetWorkspaceCellTransfer 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="workspace">Control instance for drop.</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 DragTargetWorkspaceCellTransfer(Rectangle screenRect,
                                        Rectangle hotRect,
                                        Rectangle drawRect,
                                        KryptonWorkspace workspace,
                                        KryptonWorkspaceCell cell,
                                        KryptonPageFlags allowFlags)
     : base(screenRect, hotRect, drawRect, DragTargetHint.Transfer, workspace, allowFlags)
 {
     _cell = cell;
     _notDraggedPagesFromCell = -1;
 }
Пример #9
0
 /// <summary>
 /// Initialize a new instance of the DragTargetWorkspaceCellTransfer 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="workspace">Control instance for drop.</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 DragTargetWorkspaceCellTransfer(Rectangle screenRect,
                                        Rectangle hotRect,
                                        Rectangle drawRect,
                                        KryptonWorkspace workspace,
                                        KryptonWorkspaceCell cell,
                                        KryptonPageFlags allowFlags)
     : base(screenRect, hotRect, drawRect, DragTargetHint.Transfer, workspace, allowFlags)
 {
     _cell = cell;
     _notDraggedPagesFromCell = -1;
 }
Пример #10
0
 /// <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;
 }
Пример #11
0
 /// <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;
 }
Пример #12
0
 /// <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;
 }
Пример #13
0
 /// <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>
 /// Set all the provided flags to true.
 /// </summary>
 /// <param name="flags">Flags to set.</param>
 public override void SetFlags(KryptonPageFlags flags)
 {
     Page.SetFlags(flags);
 }
 /// <summary>
 /// Set all the provided flags to true.
 /// </summary>
 /// <param name="flags">Flags to set.</param>
 public override void SetFlags(KryptonPageFlags flags)
 {
     Page.SetFlags(flags);
 }
Пример #16
0
 /// <summary>
 /// Initialize a new instance of the KryptonPageFlagsEventArgs class.
 /// </summary>
 /// <param name="flags">KryptonPageFlags enumeration.</param>
 public KryptonPageFlagsEventArgs(KryptonPageFlags flags)
 {
     // Remember parameter details
     Flags = flags;
 }
 /// <summary>
 /// Are all the provided flags set to true.
 /// </summary>
 /// <param name="flags">Flags to test.</param>
 /// <returns>True if all provided flags are defined as true; otherwise false.</returns>
 public override bool AreFlagsSet(KryptonPageFlags flags)
 {
     return Page.AreFlagsSet(flags);
 }
 /// <summary>
 /// Sets all the provided flags to false.
 /// </summary>
 /// <param name="flags">Flags to set.</param>
 public override void ClearFlags(KryptonPageFlags flags)
 {
     Page.ClearFlags(flags);
 }
Пример #19
0
 /// <summary>
 /// Raises the FlagsChanged event.
 /// </summary>
 /// <param name="changed">Set of flags that have changed.</param>
 protected virtual void OnFlagsChanged(KryptonPageFlags changed)
 {
     if (FlagsChanged != null)
         FlagsChanged(this, new KryptonPageFlagsEventArgs(changed));
 }
 /// <summary>
 /// Initialize a new instance of the KryptonPageFlagsEventArgs class.
 /// </summary>
 /// <param name="flags">KryptonPageFlags enumeration.</param>
 public KryptonPageFlagsEventArgs(KryptonPageFlags flags)
 {
     // Remember parameter details
     _flags = flags;
 }
Пример #21
0
 /// <summary>
 /// Are all the provided flags set to true.
 /// </summary>
 /// <param name="flags">Flags to test.</param>
 /// <returns>True if all provided flags are defined as true; otherwise false.</returns>
 public virtual bool AreFlagsSet(KryptonPageFlags flags)
 {
     return _flags.AreFlagsSet((int)flags);
 }
 /// <summary>
 /// Are all the provided flags set to true.
 /// </summary>
 /// <param name="flags">Flags to test.</param>
 /// <returns>True if all provided flags are defined as true; otherwise false.</returns>
 public override bool AreFlagsSet(KryptonPageFlags flags)
 {
     return(Page.AreFlagsSet(flags));
 }
 /// <summary>
 /// Sets all the provided flags to false.
 /// </summary>
 /// <param name="flags">Flags to set.</param>
 public override void ClearFlags(KryptonPageFlags flags)
 {
     Page.ClearFlags(flags);
 }
Пример #24
0
        /// <summary>
        /// Generate a list of drag targets that are relevant to the provided end data.
        /// </summary>
        /// <param name="dragEndData">Pages data being dragged.</param>
        /// <param name="allowFlags">Only drop pages that have one of these flags set.</param>
        /// <returns>List of drag targets.</returns>
        public virtual DragTargetList GenerateDragTargets(PageDragEndData dragEndData, KryptonPageFlags allowFlags)
        {
            DragTargetList targets = new DragTargetList();

            // Generate target for the entire navigator client area
            targets.Add(new DragTargetNavigatorTransfer(RectangleToScreen(ClientRectangle), this, allowFlags));

            return targets;
        }
Пример #25
0
        /// <summary>
        /// Sets all the provided flags to false.
        /// </summary>
        /// <param name="flags">Flags to set.</param>
        public virtual void ClearFlags(KryptonPageFlags flags)
        {
            int changed = _flags.ClearFlags((int)flags);

            if (changed != 0)
                OnFlagsChanged((KryptonPageFlags)changed);
        }
Пример #26
0
 /// <summary>
 /// Notification that krypton page flags have changed.
 /// </summary>
 /// <param name="page">Page that has changed.</param>
 /// <param name="changed">Set of flags that have changed value.</param>
 public virtual void PageFlagsChanged(KryptonPage page, KryptonPageFlags changed)
 {
 }
 /// <summary>
 /// Initialize a new instance of the KryptonPageFlagsEventArgs class.
 /// </summary>
 /// <param name="flags">KryptonPageFlags enumeration.</param>
 public KryptonPageFlagsEventArgs(KryptonPageFlags flags) =>