Beispiel #1
0
        //------------------------------------------------------
        //
        //  Constructors
        //
        //------------------------------------------------------

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the QueryContinueDragEventArgs class.
        /// </summary>
        /// <param name="escapePressed">
        /// Escape key was pressed.
        /// </param>
        /// <param name="dragDropKeyStates">
        /// Input states.
        /// </param>
        internal QueryContinueDragEventArgs(bool escapePressed, DragDropKeyStates dragDropKeyStates)
        {
            if (!DragDrop.IsValidDragDropKeyStates(dragDropKeyStates))
            {
                Debug.Assert(false, "Invalid dragDropKeyStates");
            }

            this._escapePressed     = escapePressed;
            this._dragDropKeyStates = dragDropKeyStates;
        }
Beispiel #2
0
        //------------------------------------------------------
        //
        //  Constructors
        //
        //------------------------------------------------------

        #region Constructors

        /// <summary>
        /// Constructs a DragEventArgs instance.
        /// </summary>
        /// <param name="data">
        /// The data object used in this drag drop operation.
        /// </param>
        /// <param name="dragDropKeyStates">
        /// The current state of the mouse button and modifier keys.
        /// </param>
        /// <param name="allowedEffects">
        /// Allowed effects of a drag-and-drop operation.
        /// </param>
        /// <param name="target">
        /// The target of the event.
        /// </param>
        /// <param name="point">
        /// The current mouse position of the target.
        /// </param>
        internal DragEventArgs(IDataObject data, DragDropKeyStates dragDropKeyStates, DragDropEffects allowedEffects, DependencyObject target, Point point)
        {
            if (!DragDrop.IsValidDragDropKeyStates(dragDropKeyStates))
            {
                Debug.Assert(false, "Invalid dragDropKeyStates");
            }

            if (!DragDrop.IsValidDragDropEffects(allowedEffects))
            {
                Debug.Assert(false, "Invalid allowedEffects");
            }

            if (target == null)
            {
                Debug.Assert(false, "Invalid target");
            }

            this._data = data;
            this._dragDropKeyStates = dragDropKeyStates;
            this._allowedEffects    = allowedEffects;
            this._target            = target;
            this._dropPoint         = point;
            this._effects           = allowedEffects;
        }