BExplorer.Shell.ShellView.OnDragDrop C# (CSharp) Method

OnDragDrop() protected method

protected OnDragDrop ( System.Windows.Forms e ) : void
e System.Windows.Forms
return void
    protected override void OnDragDrop(F.DragEventArgs e) {
      Int32 row = -1;
      Int32 collumn = -1;
      this.HitTest(PointToClient(new DPoint(e.X, e.Y)), out row, out collumn);
      var destination = row != -1 ? Items[row] : CurrentFolder;
      if (!destination.IsFolder || (this._DraggedItemIndexes.Count > 0 && this._DraggedItemIndexes.Contains(row))) {
        if ((e.Effect == F.DragDropEffects.Link || e.Effect == F.DragDropEffects.Copy) && destination.Parent != null && destination.Parent.IsFolder) {
          if (e.Effect == F.DragDropEffects.Copy) {
            this.DoCopy(e.Data, destination);
          }
        } else
          e.Effect = F.DragDropEffects.None;
      } else {
        switch (e.Effect) {
          case F.DragDropEffects.Copy:
            this.DoCopy(e.Data, destination);
            break;

          case F.DragDropEffects.Link:
            System.Windows.MessageBox.Show("Link creation not implemented yet!", "Not implemented", MessageBoxButton.OK, MessageBoxImage.Exclamation);
            break;

          case F.DragDropEffects.Move:
            this.DoMove(e.Data, destination);
            break;

          case F.DragDropEffects.All:
          case F.DragDropEffects.None:
          case F.DragDropEffects.Scroll:
            break;

          default:
            break;
        }
      }
      var wp = new DataObject.Win32Point() { X = e.X, Y = e.Y };

      if (e.Data.GetDataPresent("DragImageBits"))
        DropTarget.Create.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref wp, (Int32)e.Effect);
      else
        base.OnDragDrop(e);

      this.RefreshItem(_LastDropHighLightedItemIndex);
      _LastDropHighLightedItemIndex = -1;
    }
ShellView