Esempio n. 1
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:
                ListView.MoveObjects(args.DropTargetIndex, args.SourceModels);
                break;

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

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

            default:
                return;
            }

            if (args.SourceListView != ListView)
            {
                args.SourceListView.RemoveObjects(args.SourceModels);
            }
        }