当前位置: 首页>>代码示例>>C#>>正文


C# Presentation.RoutedEventData类代码示例

本文整理汇总了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;
     }
 }
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:20,代码来源:GameMenuViewModel.cs

示例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;
        }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:20,代码来源:LinkUtil.cs

示例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);
                }
            }
        }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:19,代码来源:RoutedEventRaisedNotificationServer.cs

示例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;
        }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:22,代码来源:LinkUtil.cs

示例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;
            }
        }
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:27,代码来源:GamePlayViewModel.cs

示例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);
 }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:7,代码来源:UIElement.IInputElement.cs

示例7: OnLostMouseCaptureProxy

 /// <summary>
 /// Invokes the <see cref="OnLostMouseCapture"/> method.
 /// </summary>
 private static void OnLostMouseCaptureProxy(DependencyObject element, RoutedEventData data)
 {
     ((UIElement)element).OnLostMouseCapture(data);
 }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:7,代码来源:UIElement.IInputElement.cs

示例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);
 }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:7,代码来源:UIElement.IInputElement.cs

示例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);
 }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:7,代码来源:UIElement.IInputElement.cs

示例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)
        {

        }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:10,代码来源:UIElement.IInputElement.cs

示例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)
        {

        }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:10,代码来源:UIElement.IInputElement.cs

示例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)
        {

        }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:9,代码来源:UIElement.IInputElement.cs

示例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)
        {

        }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:9,代码来源:UIElement.IInputElement.cs

示例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)
        {

        }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:10,代码来源:UIElement.IInputElement.cs

示例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)
        {

        }
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:11,代码来源:UIElement.IInputElement.cs


注:本文中的TwistedLogik.Ultraviolet.UI.Presentation.RoutedEventData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。