private void empty_DragOver(object sender, DragEventArgs e) { if (e.IsDataPresent<ProviderTokenTileDragEventArgs>()) { var args = e.GetData<ProviderTokenTileDragEventArgs>(); args.Location = new Point(e.X, e.Y); } OnDragOver(e); }
private void empty_DragDrop(object sender, DragEventArgs e) { if (!AllowDrop || !e.IsDataPresent<ProviderTokenTileDragEventArgs>()) return; var args = e.GetData<ProviderTokenTileDragEventArgs>(); args.Location = new Point(e.X, e.Y); if (args != null) { AboutToDrop(this, args); if (!args.Cancel && !args.Handled) Token = args.TokenTile.Token; } }
private void empty_DragEnter(object sender, DragEventArgs e) { if (!AllowDrop || !e.IsDataPresent<ProviderTokenTileDragEventArgs>()) { e.Effect = DragDropEffects.None; return; } e.Effect = DragDropEffects.Copy; var args = e.GetData<ProviderTokenTileDragEventArgs>(); Size sz = args.TokenTile.DisplayRectangle.Size; Bitmap bm = new Bitmap(sz.Width, sz.Height); using (var g = Graphics.FromImage(bm)) args.TokenTile.paint(g); Cursor.Current = CreateCursor(bm, 0, 0); bm.Dispose(); OnDragEnter(e); }
private void _view_DragEnter(object sender, DragEventArgs e) { ProviderTokenTile tile = sender as ProviderTokenTile; if (!AllowDragArrange || _scrolling || tile == null || tile == _empty || !e.IsDataPresent<ProviderTokenTileDragEventArgs>()) return; if (!_internalDrag) { var args = e.GetData<ProviderTokenTileDragEventArgs>(); args.TokenTile.QueryContinueDrag += new QueryContinueDragEventHandler(tile_QueryContinueDrag); } int index = _flow.Controls.IndexOf(tile); _flow.Controls.Add(_empty); _flow.Controls.SetChildIndex(_empty, index); }