Exemplo n.º 1
0
        protected internal override void OnDragOver(DragEventArgs e)
        {
            base.OnDragOver(e);
            PropertyEditor lastHoverEditor = this.hoverEditor;

            this.hoverEditor = this.PickEditorAt(e.X, e.Y, true);
            if (this.hoverEditor == this)
            {
                this.hoverEditor = null;
            }

            if (lastHoverEditor != this.hoverEditor && lastHoverEditor != null)
            {
                lastHoverEditor.OnDragLeave(EventArgs.Empty);
            }
            if (lastHoverEditor != this.hoverEditor && this.hoverEditor != null)
            {
                e.Effect = DragDropEffects.None;
                this.hoverEditor.OnDragEnter(e);
            }

            if (this.hoverEditor != null)
            {
                Point         editorLoc  = this.GetChildLocation(this.hoverEditor);
                DragEventArgs childEvent = new DragEventArgs(
                    e.Data,
                    e.KeyState,
                    e.X - editorLoc.X,
                    e.Y - editorLoc.Y,
                    e.AllowedEffect,
                    e.Effect);
                this.hoverEditor.OnDragOver(childEvent);
                e.Effect = childEvent.Effect;
            }
            else
            {
                e.Effect = DragDropEffects.None;
            }
        }