本文整理汇总了C#中System.Windows.QueryContinueDragEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# QueryContinueDragEventArgs类的具体用法?C# QueryContinueDragEventArgs怎么用?C# QueryContinueDragEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QueryContinueDragEventArgs类属于System.Windows命名空间,在下文中一共展示了QueryContinueDragEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnQueryContinueDrag
protected override void OnQueryContinueDrag(QueryContinueDragEventArgs e)
{
base.OnQueryContinueDrag(e);
e.Action = DragAction.Cancel;
e.Handled = true;
}
示例2: triggerElement_QueryContinueDrag
private static void triggerElement_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
{
e.Action = DragAction.Drop;
if ((e.KeyStates & DragDropKeyStates.LeftMouseButton) != DragDropKeyStates.None)
e.Action = DragAction.Continue;
if (e.Action == DragAction.Drop)
_contentPresenter = null;
}
示例3: OnPreviewQueryContinueDrag
protected override void OnPreviewQueryContinueDrag(QueryContinueDragEventArgs args)
{
base.OnPreviewQueryContinueDrag(args);
if (args.Action == DragAction.Cancel || args.Action == DragAction.Drop) {
CancelDrag();
} else if (args.Action == DragAction.Continue) {
Point p = MouseUtilities.GetMousePosition(this);
if ((p.Y < DRAG_MARGIN) || (p.Y > RenderSize.Height - DRAG_MARGIN)) {
if (_dragScrollTimer == null) {
_dragVelocity = DRAG_INITIAL_VELOCITY;
_dragScrollTimer = new DispatcherTimer();
_dragScrollTimer.Tick += TickDragScroll;
_dragScrollTimer.Interval = new TimeSpan(0, 0, 0, 0, (int)DRAG_INTERVAL);
_dragScrollTimer.Start();
}
}
}
}
示例4: OnPreviewQueryContinueDrag
protected override void OnPreviewQueryContinueDrag(QueryContinueDragEventArgs args)
{
base.OnPreviewQueryContinueDrag(args);
if (args.Action == DragAction.Cancel || args.Action == DragAction.Drop)
{
CancelDrag();
}
else if (args.Action == DragAction.Continue)
{
Point p = MouseUtilities.GetMousePosition(this);
if ((p.Y < s_dragMargin) || (p.Y > RenderSize.Height - s_dragMargin))
{
if (_dragScrollTimer == null)
{
_dragVelocity = s_dragInitialVelocity;
_dragScrollTimer = new DispatcherTimer();
_dragScrollTimer.Tick += TickDragScroll;
_dragScrollTimer.Interval = new TimeSpan(0, 0, 0, 0, (int)s_dragInterval);
_dragScrollTimer.Start();
}
}
}
}
示例5: textArea_QueryContinueDrag
void textArea_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
{
try {
if (e.EscapePressed) {
e.Action = DragAction.Cancel;
} else if ((e.KeyStates & DragDropKeyStates.LeftMouseButton) != DragDropKeyStates.LeftMouseButton) {
e.Action = DragAction.Drop;
} else {
e.Action = DragAction.Continue;
}
e.Handled = true;
} catch (Exception ex) {
OnDragException(ex);
}
}
示例6: DefaultQueryContinueDragHandler
public static void DefaultQueryContinueDragHandler(object sender, QueryContinueDragEventArgs e)
{
DataObjectExtensions.DefaultQueryContinueDrag(e);
}
示例7: DragScope_QueryContinueDrag
void DragScope_QueryContinueDrag(object sender, QueryContinueDragEventArgs e)
{
if (this._dragHasLeftScope)
{
e.Action = DragAction.Cancel;
e.Handled = true;
}
}
示例8: OnQueryContinueDrag
/// <summary>
/// Virtual method reporting the query continue drag is going to happen
/// </summary>
protected internal virtual void OnQueryContinueDrag(QueryContinueDragEventArgs e) {}
示例9: OnQueryContinueDragThunk
private static void OnQueryContinueDragThunk(object sender, QueryContinueDragEventArgs e)
{
Invariant.Assert(!e.Handled, "Unexpected: Event has already been handled.");
UIElement uie = sender as UIElement;
if (uie != null)
{
uie.OnQueryContinueDrag(e);
}
else
{
ContentElement ce = sender as ContentElement;
if (ce != null)
{
ce.OnQueryContinueDrag(e);
}
else
{
((UIElement3D)sender).OnQueryContinueDrag(e);
}
}
}
示例10: MouseElement_QueryContinueDrag
void MouseElement_QueryContinueDrag(object sender, QueryContinueDragEventArgs e) {
foreach (var m in mouseProcessors) {
if (e.Handled)
break;
m.PreprocessQueryContinueDrag(e);
}
if (!e.Handled)
defaultMouseProcessor.OnQueryContinueDrag(sender, e);
foreach (var m in mouseProcessors)
m.PostprocessQueryContinueDrag(e);
}
示例11: DragSourceQueryContinueDrag
private void DragSourceQueryContinueDrag(object sender, QueryContinueDragEventArgs e)
{
UpdateWindowLocation();
}
示例12: DragScopeQueryContinueDrag
private void DragScopeQueryContinueDrag(object sender, QueryContinueDragEventArgs e)
{
if (!_dragHasLeftScope) return;
e.Action = DragAction.Cancel;
e.Handled = true;
}
示例13: PictureToAssign_OnQueryContinueDrag
private void PictureToAssign_OnQueryContinueDrag (object Sender, QueryContinueDragEventArgs E)
{
if (E.Action != DragAction.Continue)
{
DragStartPosition = new Point (0, 0);
IsDragging = false;
}
}
示例14: OnDefaultQueryContinueDrag
/// <summary>
/// Default query continue drag during drag-and-drop operation.
/// </summary>
/// <remarks>
/// At this stage we do not know application's intended mouse
/// button combination for dragging. For default purposes we assume
/// that the DragDrop happens due to single mouse button press.
/// Hence if any two mouse buttons are pressed at any point of time,
/// then we cancel the drapdrop. Also if no mouse buttons are pressed at
/// any point of time, then we complete the drop. If an application intends
/// to privide multi-button press dragging (like dragging by pressing
/// both left and right buttons of mouse) applications will have
/// to handle (Preview)QueryContiueDragEvent to the allow
/// such valid combinations explicitly.
/// </remarks>
private void OnDefaultQueryContinueDrag(QueryContinueDragEventArgs e)
{
int mouseButtonDownCount = 0;
if ((e.KeyStates & DragDropKeyStates.LeftMouseButton) == DragDropKeyStates.LeftMouseButton)
{
mouseButtonDownCount++;
}
if ((e.KeyStates & DragDropKeyStates.MiddleMouseButton) == DragDropKeyStates.MiddleMouseButton)
{
mouseButtonDownCount++;
}
if ((e.KeyStates & DragDropKeyStates.RightMouseButton) == DragDropKeyStates.RightMouseButton)
{
mouseButtonDownCount++;
}
e.Action = DragAction.Continue;
if (e.EscapePressed ||
mouseButtonDownCount >= 2)
{
e.Action = DragAction.Cancel;
}
else if (mouseButtonDownCount == 0)
{
e.Action = DragAction.Drop;
}
}
示例15: RaiseQueryContinueDragEvent
/// <summary>
/// Raise QueryContinueDrag event for Tunel and Bubble.
/// </summary>
private void RaiseQueryContinueDragEvent(QueryContinueDragEventArgs args)
{
// Set PreviewQueryContinueDrag(Tunnel) first.
args.RoutedEvent=DragDrop.PreviewQueryContinueDragEvent;
// Raise the preview QueryContinueDrag event(Tunnel).
if (_dragSource is UIElement)
{
((UIElement)_dragSource).RaiseEvent(args);
}
else if (_dragSource is ContentElement)
{
((ContentElement)_dragSource).RaiseEvent(args);
}
else if (_dragSource is UIElement3D)
{
((UIElement3D)_dragSource).RaiseEvent(args);
}
else
{
throw new ArgumentException(SR.Get(SRID.ScopeMustBeUIElementOrContent), "scope");
}
// Set QueryContinueDrag(Bubble).
args.RoutedEvent = DragDrop.QueryContinueDragEvent;
// Raise QueryContinueDrag event(Bubble).
if (!args.Handled)
{
if (_dragSource is UIElement)
{
((UIElement)_dragSource).RaiseEvent(args);
}
else if (_dragSource is ContentElement)
{
((ContentElement)_dragSource).RaiseEvent(args);
}
else if (_dragSource is UIElement3D)
{
((UIElement3D)_dragSource).RaiseEvent(args);
}
else
{
throw new ArgumentException(SR.Get(SRID.ScopeMustBeUIElementOrContent), "scope");
}
}
// Call the default event handling method internally if no one handle the drag source events.
if (!args.Handled)
{
OnDefaultQueryContinueDrag(args);
}
}