示例#1
0
        /// <summary>
        /// Drops the data on the target with the given drop effect. <c>additionalDropInfo</c> may contain
        /// additonal data that can be used during the drop operation, depending on the type of target UI control
        /// </summary>
        public void DoDrop(IDataObject data, DragDropEffect effect, AdditionalDropInfo additionalDropInfo)
        {
            DragDropItemHandlerBase ItemHandler = this.GetItemHandler(data);

            if (ItemHandler != null)
            {
                ItemHandler.DoDrop(data, effect, additionalDropInfo);
            }
            else
            {
                throw new InvalidOperationException("drag drop not requested, but doDrop was called");
            }
        }
示例#2
0
        /// <summary>
        /// Gets the default effect that shall be used when no modifier key is pressed (but only if the
        /// source supports the effect)
        /// </summary>
        public DragDropEffect GetDefaultEffect(IDataObject data)
        {
            DragDropItemHandlerBase ItemHandler = this.GetItemHandler(data);

            if (ItemHandler != null)
            {
                return(ItemHandler.GetDefaultEffect(data));
            }
            else
            {
                return(DragDropEffect.None);
            }
        }