Provides data for a cancelable event.
Наследование: System.ComponentModel.CancelEventArgs
Пример #1
0
        /// <summary>
        /// Initializes a selection or drag operation.
        /// </summary>
        /// <param name="e">The <see cref="MouseEventArgs"/> instance containing the event data.</param>
        protected virtual void StartDrag(MouseEventArgs e)
        {
            ImageBoxCancelEventArgs args;

            args = new ImageBoxCancelEventArgs(e.Location);

            this.OnSelecting(args);

            this.WasDragCancelled = args.Cancel;
            this.IsSelecting = !args.Cancel;
            if (this.IsSelecting)
            {
                this.SelectNone();

                _startMousePosition = e.Location;
            }
        }
Пример #2
0
        /// <summary>
        ///   Raises the <see cref="ImageBox.Selecting" /> event.
        /// </summary>
        /// <param name="e">
        ///   The <see cref="System.EventArgs" /> instance containing the event data.
        /// </param>
        protected override void OnSelecting(ImageBoxCancelEventArgs e)
        {
            e.Cancel = this.IsMovingSelection || this.IsResizingSelection || this.SelectionRegion.Contains(this.PointToImage(e.Location)) || this.HitDragHandleTest(e.Location) != DragHandleAnchor.None;

            base.OnSelecting(e);
        }
Пример #3
0
        /// <summary>
        ///   Raises the <see cref="Selecting" /> event.
        /// </summary>
        /// <param name="e">
        ///   The <see cref="System.EventArgs" /> instance containing the event data.
        /// </param>
        protected virtual void OnSelecting(ImageBoxCancelEventArgs e)
        {
            EventHandler<ImageBoxCancelEventArgs> handler;

            handler = this.Selecting;

            if (handler != null)
            {
                handler(this, e);
            }
        }