當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。