Exemplo n.º 1
0
 protected virtual void OnModelDropped(ModelDropEventArgs args)
 {
     if (this.ModelDropped != null)
     {
         this.ModelDropped(this, args);
     }
 }
Exemplo n.º 2
0
 protected virtual void OnModelCanDrop(ModelDropEventArgs args)
 {
     if (this.ModelCanDrop != null)
     {
         this.ModelCanDrop(this, args);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Do the work of processing the dropped items
        /// </summary>
        /// <param name="args"></param>
        public virtual void RearrangeModels(ModelDropEventArgs args)
        {
            switch (args.DropTargetLocation)
            {
            case DropTargetLocation.AboveItem:
                this.ListView.MoveObjects(args.DropTargetIndex, args.SourceModels);
                break;

            case DropTargetLocation.BelowItem:
                this.ListView.MoveObjects(args.DropTargetIndex + 1, args.SourceModels);
                break;

            case DropTargetLocation.Background:
                this.ListView.AddObjects(args.SourceModels);
                break;

            default:
                return;
            }

            if (args.SourceListView != this.ListView)
            {
                args.SourceListView.RemoveObjects(args.SourceModels);
            }
        }
Exemplo n.º 4
0
        protected override void OnModelCanDrop(ModelDropEventArgs args)
        {
            base.OnModelCanDrop(args);

            if (args.Handled)
            {
                return;
            }

            args.Effect = DragDropEffects.Move;

            // Don't allow drops from other list, if that's what's configured
            if (!this.AcceptExternal && args.SourceListView != this.ListView)
            {
                args.Effect             = DragDropEffects.None;
                args.DropTargetLocation = DropTargetLocation.None;
                args.InfoMessage        = "This list doesn't accept drops from other lists";
            }

            // If we are rearranging a list, don't allow drops on the background
            if (args.DropTargetLocation == DropTargetLocation.Background && args.SourceListView == this.ListView)
            {
                args.Effect             = DragDropEffects.None;
                args.DropTargetLocation = DropTargetLocation.None;
            }
        }
Exemplo n.º 5
0
        protected override void OnModelDropped(ModelDropEventArgs args)
        {
            base.OnModelDropped(args);

            if (!args.Handled)
            {
                this.RearrangeModels(args);
            }
        }
 protected virtual void OnModelDropped(ModelDropEventArgs args) {
     if (this.ModelDropped != null)
         this.ModelDropped(this, args);
 }
 protected virtual void OnModelCanDrop(ModelDropEventArgs args) {
     if (this.ModelCanDrop != null)
         this.ModelCanDrop(this, args);
 }
        /// <summary>
        /// Do the work of processing the dropped items
        /// </summary>
        /// <param name="args"></param>
        public virtual void RearrangeModels(ModelDropEventArgs args) {
            switch (args.DropTargetLocation) {
                case DropTargetLocation.AboveItem:
                    this.ListView.MoveObjects(args.DropTargetIndex, args.SourceModels);
                    break;
                case DropTargetLocation.BelowItem:
                    this.ListView.MoveObjects(args.DropTargetIndex + 1, args.SourceModels);
                    break;
                case DropTargetLocation.Background:
                    this.ListView.AddObjects(args.SourceModels);
                    break;
                default:
                    return;
            }

            if (args.SourceListView != this.ListView) {
                args.SourceListView.RemoveObjects(args.SourceModels);
            }
        }
        protected override void OnModelDropped(ModelDropEventArgs args) {
            base.OnModelDropped(args);

            if (!args.Handled)
                this.RearrangeModels(args);
        }
        protected override void OnModelCanDrop(ModelDropEventArgs args) {
            base.OnModelCanDrop(args);

            if (args.Handled)
                return;

            args.Effect = DragDropEffects.Move;

            // Don't allow drops from other list, if that's what's configured
            if (!this.AcceptExternal && args.SourceListView != this.ListView) {
                args.Effect = DragDropEffects.None;
                args.DropTargetLocation = DropTargetLocation.None;
                args.InfoMessage = "This list doesn't accept drops from other lists";
            }

            // If we are rearranging a list, don't allow drops on the background
            if (args.DropTargetLocation == DropTargetLocation.Background && args.SourceListView == this.ListView) {
                args.Effect = DragDropEffects.None;
                args.DropTargetLocation = DropTargetLocation.None;
            }
        }