示例#1
0
        private void ListViewControl_DragDrop(object sender, DragEventArgs e)
        {
            if (e.Effect != DragDropEffects.Copy)
            {
                return;
            }
            if (!e.Data.GetDataPresent(typeof(DragDropData)))
            {
                return;
            }

            DragDropData   data   = e.Data.GetData(typeof(DragDropData)) as DragDropData;
            DragDropKey    key    = new DragDropKey(data.SourceColumn.GetType().FullName, GetType().FullName);
            DragDropAction action = Host.DragDropHandlers[key];

            action.Invoke(data.SourceColumn, this, data.Items);
        }
示例#2
0
        private void ListViewControl_DragEnter(object sender, DragEventArgs e)
        {
            e.Effect = DragDropEffects.None;
            if (!e.Data.GetDataPresent(typeof(DragDropData)))
            {
                return;
            }

            DragDropData data = e.Data.GetData(typeof(DragDropData)) as DragDropData;
            DragDropKey  key  = new DragDropKey(data.SourceColumn.GetType().FullName, GetType().FullName);

            if (!Host.DragDropHandlers.ContainsKey(key))
            {
                return;
            }

            e.Effect = DragDropEffects.Copy;
        }