本文整理汇总了C#中System.Windows.Forms.DragEventArgs.IsDataPresent方法的典型用法代码示例。如果您正苦于以下问题:C# DragEventArgs.IsDataPresent方法的具体用法?C# DragEventArgs.IsDataPresent怎么用?C# DragEventArgs.IsDataPresent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.DragEventArgs
的用法示例。
在下文中一共展示了DragEventArgs.IsDataPresent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: empty_DragOver
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);
}
示例2: empty_DragDrop
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;
}
}
示例3: empty_DragEnter
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);
}
示例4: _view_DragEnter
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);
}