本文整理汇总了C#中TwistedLogik.Ultraviolet.UI.Presentation.RoutedEventData类的典型用法代码示例。如果您正苦于以下问题:C# RoutedEventData类的具体用法?C# RoutedEventData怎么用?C# RoutedEventData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RoutedEventData类属于TwistedLogik.Ultraviolet.UI.Presentation命名空间,在下文中一共展示了RoutedEventData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleKeyDown
/// <summary>
/// Handles the <see cref="Keyboard.KeyDownEvent"/> attached event for the view's topmost <see cref="Grid"/> instance.
/// </summary>
/// <param name="dobj">The object that raised the event.</param>
/// <param name="device">The <see cref="KeyboardDevice"/> that raised the event.</param>
/// <param name="key">The <see cref="Key"/> value that represents the key that was pressed.</param>
/// <param name="modifiers">A <see cref="ModifierKeys"/> value indicating which of the key modifiers are currently active.</param>
/// <param name="data">The routed event metadata for this event invocation.</param>
public void HandleKeyDown(DependencyObject dobj, KeyboardDevice device, Key key, ModifierKeys modifiers, ref RoutedEventData data)
{
switch (key)
{
case Key.AppControlBack:
{
owner.Ultraviolet.Host.Exit();
data.Handled = true;
}
break;
}
}
示例2: ActivateTextLink
/// <summary>
/// Activates any link at the current cursor position within the specified command stream.
/// </summary>
/// <param name="stream">The command stream to update.</param>
/// <param name="element">The element that owns the command stream.</param>
/// <param name="data">The event metadata for the routed event which prompted the link activation.</param>
/// <returns><see langword="true"/> if the command stream's link was deactivated; otherwise, <see langword="false"/>.</returns>
public static Boolean ActivateTextLink(TextLayoutCommandStream stream, UIElement element, RoutedEventData data)
{
Contract.Require(element, nameof(element));
if (stream == null || element.View == null || !element.View.Resources.TextRenderer.ActivateLinkAtCursor(stream))
return false;
element.Focus();
element.CaptureMouse();
data.Handled = true;
return true;
}
示例3: Notify
/// <summary>
/// Raises a property change notification for all subscribers to the specified target.
/// </summary>
/// <param name="target">The target object for which to raise a notification.</param>
/// <param name="data">The routed event data.</param>
public void Notify(DependencyObject target, RoutedEventData data)
{
lock (subscriptions)
{
PooledLinkedList<IRoutedEventRaisedNotificationSubscriber> subscribers;
if (!subscriptions.TryGetValue(target, out subscribers))
return;
for (var current = subscribers.First; current != null; current = current.Next)
{
current.Value.ReceiveRoutedEventRaisedNotification(target, routedEvent, data);
}
}
}
示例4: ExecuteTextLink
/// <summary>
/// Executes any link at the current cursor position within the specified command stream.
/// </summary>
/// <param name="stream">The command stream to update.</param>
/// <param name="element">The element that owns the command stream.</param>
/// <param name="data">The event metadata for the routed event which prompted the link execution.</param>
public static Boolean ExecuteTextLink(TextLayoutCommandStream stream, UIElement element, RoutedEventData data)
{
Contract.Require(element, nameof(element));
if (stream == null || element.View == null)
return false;
if (stream.ActiveLinkIndex.HasValue)
element.ReleaseMouseCapture();
if (!element.View.Resources.TextRenderer.ExecuteActivatedLink(stream))
return false;
data.Handled = true;
return true;
}
示例5: HandleKeyDown
/// <summary>
/// Handles the <see cref="Keyboard.KeyDownEvent"/> attached event for the view's topmost <see cref="Grid"/> instance.
/// </summary>
/// <param name="dobj">The object that raised the event.</param>
/// <param name="device">The <see cref="KeyboardDevice"/> that raised the event.</param>
/// <param name="key">The <see cref="Key"/> value that represents the key that was pressed.</param>
/// <param name="modifiers">A <see cref="ModifierKeys"/> value indicating which of the key modifiers are currently active.</param>
/// <param name="data">The routed event metadata for this event invocation.</param>
public void HandleKeyDown(DependencyObject dobj, KeyboardDevice device, Key key, ModifierKeys modifiers, ref RoutedEventData data)
{
switch (key)
{
case Key.Escape:
{
Modal.ShowDialogAsync(escMenuDialog).ContinueWith(HandleEscMenuDialogResult);
data.Handled = true;
}
break;
case Key.AppControlBack:
{
ReturnToMainMenu();
data.Handled = true;
}
break;
}
}
示例6: OnMouseMoveProxy
/// <summary>
/// Invokes the <see cref="OnMouseMove"/> method.
/// </summary>
private static void OnMouseMoveProxy(DependencyObject element, MouseDevice device, Double x, Double y, Double dx, Double dy, RoutedEventData data)
{
((UIElement)element).OnMouseMove(device, x, y, dx, dy, data);
}
示例7: OnLostMouseCaptureProxy
/// <summary>
/// Invokes the <see cref="OnLostMouseCapture"/> method.
/// </summary>
private static void OnLostMouseCaptureProxy(DependencyObject element, RoutedEventData data)
{
((UIElement)element).OnLostMouseCapture(data);
}
示例8: OnKeyUpProxy
/// <summary>
/// Invokes the <see cref="OnKeyUp"/> method.
/// </summary>
private static void OnKeyUpProxy(DependencyObject element, KeyboardDevice device, Key key, RoutedEventData data)
{
((UIElement)element).OnKeyUp(device, key, data);
}
示例9: OnLostKeyboardFocusProxy
/// <summary>
/// Invokes the <see cref="OnLostKeyboardFocus"/> method.
/// </summary>
private static void OnLostKeyboardFocusProxy(DependencyObject element, KeyboardDevice device, IInputElement oldFocus, IInputElement newFocus, RoutedEventData data)
{
((UIElement)element).OnLostKeyboardFocus(device, oldFocus, newFocus, data);
}
示例10: OnGamePadButtonUp
/// <summary>
/// Invokes by the <see cref="GamePad.ButtonUpEvent"/> attached routed event.
/// </summary>
/// <param name="device">The game pad device.</param>
/// <param name="button">The button that was released.</param>
/// <param name="data">The routed event metadata for this event invocation.</param>
protected virtual void OnGamePadButtonUp(GamePadDevice device, GamePadButton button, RoutedEventData data)
{
}
示例11: OnGamePadAxisUp
/// <summary>
/// Invokes by the <see cref="GamePad.AxisUpEvent"/> attached routed event.
/// </summary>
/// <param name="device">The game pad device.</param>
/// <param name="axis">The axis that was released.</param>
/// <param name="data">The routed event metadata for this event invocation.</param>
protected virtual void OnGamePadAxisUp(GamePadDevice device, GamePadAxis axis, RoutedEventData data)
{
}
示例12: OnTextEditing
/// <summary>
/// Invoked when a <see cref="Keyboard.TextEditingEvent"/> attached routed event occurs.
/// </summary>
/// <param name="device">The <see cref="KeyboardDevice"/> that raised the event.</param>
/// <param name="data">The routed event metadata for this event invocation.</param>
protected virtual void OnTextEditing(KeyboardDevice device, RoutedEventData data)
{
}
示例13: OnTextInput
/// <summary>
/// Invoked when a <see cref="Keyboard.TextInputEvent"/> attached routed event occurs.
/// </summary>
/// <param name="device">The <see cref="KeyboardDevice"/> that raised the event.</param>
/// <param name="data">The routed event metadata for this event invocation.</param>
protected virtual void OnTextInput(KeyboardDevice device, RoutedEventData data)
{
}
示例14: OnKeyUp
/// <summary>
/// Invoked when a <see cref="Keyboard.KeyUpEvent"/> attached routed event occurs.
/// </summary>
/// <param name="device">The <see cref="KeyboardDevice"/> that raised the event.</param>
/// <param name="key">The <see cref="Key"/> value that represents the key that was pressed.</param>
/// <param name="data">The routed event metadata for this event invocation.</param>
protected virtual void OnKeyUp(KeyboardDevice device, Key key, RoutedEventData data)
{
}
示例15: OnKeyDown
/// <summary>
/// Invoked when a <see cref="Keyboard.KeyDownEvent"/> attached routed event occurs.
/// </summary>
/// <param name="device">The <see cref="KeyboardDevice"/> that raised the event.</param>
/// <param name="key">The <see cref="Key"/> value that represents the key that was pressed.</param>
/// <param name="modifiers">A <see cref="ModifierKeys"/> value indicating which of the key modifiers are currently active.</param>
/// <param name="data">The routed event metadata for this event invocation.</param>
protected virtual void OnKeyDown(KeyboardDevice device, Key key, ModifierKeys modifiers, RoutedEventData data)
{
}