當前位置: 首頁>>代碼示例>>C#>>正文


C# Input.InputEventArgs類代碼示例

本文整理匯總了C#中System.Windows.Input.InputEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# InputEventArgs類的具體用法?C# InputEventArgs怎麽用?C# InputEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


InputEventArgs類屬於System.Windows.Input命名空間,在下文中一共展示了InputEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnInput

 protected override void OnInput(object sender, InputEventArgs e)
 {
     if (this._gestureStarted)
     {
         base.OnInput(sender, e);
     }
 }
開發者ID:JohanLarsson,項目名稱:Gu.Wpf.FlipView,代碼行數:7,代碼來源:MouseBox.xaml.cs

示例2: Matches

        public override bool Matches(object targetElement, InputEventArgs inputEventArgs)
        {
            var args = inputEventArgs as KeyEventArgs;

            if ((args == null) || !IsDefinedKey(args.Key))
            {
                return false;
            }
            Debug.WriteLine("Modifiers: " + Keyboard.Modifiers);

            if (IsTooLongFromLastKey() || IsWrongModifiers() || IsWrongKey(args.Key))
            {
                currentKeyIndex = 0;
                return false;
            }

            ++currentKeyIndex;

            if (IsMatchingContinued())
            {
                lastPress = DateTime.Now;
                inputEventArgs.Handled = true;
                return false;
            }

            currentKeyIndex = 0;
            Debug.WriteLine("Match completed!");
            return true;
        }
開發者ID:CuteITGuy,項目名稱:CB.Xaml,代碼行數:29,代碼來源:MultiKeyGesture.cs

示例3: Matches

        public override bool Matches(object targetElement, InputEventArgs inputEventArgs)
        {
            if (this._index >= this._gestures.Count) this._index = 0;

            KeyEventArgs e = inputEventArgs as KeyEventArgs;
            if (e == null || IsIgnorableKey(e.Key, e.KeyboardDevice.Modifiers))
            {
                return false;
            }

            if (this._index > 0 && (DateTime.Now - this._lastKeyPress) > _keyPressInterval)
            {
                this._index = 0;
            }

            if (this._gestures[this._index].Matches(targetElement, inputEventArgs))
            {
                this._lastKeyPress = DateTime.Now;
                this._index++;
                inputEventArgs.Handled = true;
                return (this._index == this._gestures.Count);
            }
            else
            {
                this._index = 0;
                return false;
            }
        }
開發者ID:jbunzel,項目名稱:MvcRQ_git,代碼行數:28,代碼來源:ComplexInputGesture.cs

示例4: Button_PreviewCSEDown

 private void Button_PreviewCSEDown(object sender, InputEventArgs e)
 {
     items.IndexOf(files[0]);
     MainLibraryStack.SelectedIndex = items.IndexOf(files[0]);
     //items.Remove(files[1]);
     //items.Insert(0, files[1]);
 }
開發者ID:sgoo,項目名稱:se306p2,代碼行數:7,代碼來源:ECE_Advisors.xaml.cs

示例5: Matches

        public override bool Matches(object targetElement, InputEventArgs inputEventArgs)
        {
            var args = inputEventArgs as KeyEventArgs;

            // Don't execute input binding in case focus is on a textbox
            if ((inputEventArgs.Device.Target is TextBoxBase || inputEventArgs.Device.Target is WebBrowser)
                && !(modifers == ModifierKeys.Control || modifers == ModifierKeys.Alt))
                return false;

            if (args == null)
                return false;

            bool match;

            if (useModifiers)
                match = args.Key == key && args.KeyboardDevice.Modifiers == modifers;
            else
            {
                match = (args.Key == key && args.KeyboardDevice.Modifiers == ModifierKeys.None);

                // To not interfere with multiple key gestures
                if (previous == Key.G || previous == Key.N || previous == Key.A)
                    match = false;
            }

            previous = args.Key;

            return match;
        }
開發者ID:Klaudit,項目名稱:inbox2_desktop,代碼行數:29,代碼來源:CustomGesture.cs

示例6: IsDeviceValid

 protected override bool IsDeviceValid(bool? wasValid, InputEventArgs args)
 {
     var motionDevice = args.Device as MotionTrackingDevice;
     if (motionDevice != null)
         motionDevice.ShouldPromoteToTouch = true;
     return true;
 }
開發者ID:InfoStrat,項目名稱:MotionFx,代碼行數:7,代碼來源:HoverInputFilter.cs

示例7: Matches

 ///
 /// When overridden in a derived class, determines whether the specified matches the input associated with the specified object.
 ///
 /// The target of the command.
 /// The input event data to compare this gesture to.
 ///
 /// true if the gesture matches the input; otherwise, false.
 ///
 public override bool Matches(object targetElement, InputEventArgs inputEventArgs)
 {
     KeyEventArgs args = inputEventArgs as KeyEventArgs;
     if (args != null)
         return (Key == args.Key);
     else
         return false;
 }
開發者ID:mukhtiarlander,項目名稱:git_demo_torit,代碼行數:16,代碼來源:AnyKeyGesture.cs

示例8: LeftSlideClick

 private void LeftSlideClick(object sender, InputEventArgs e)
 {
     imageIndex--;
     if (imageIndex < 1) {
         imageIndex = 8;
     }
     SlideShow(imageIndex);
     timer.Interval = new TimeSpan(0, 0, 4);
 }
開發者ID:sgoo,項目名稱:se306p2,代碼行數:9,代碼來源:homepage.xaml.cs

示例9: RightSlideClick

 private void RightSlideClick(object sender, InputEventArgs e)
 {
     imageIndex++;
     if (imageIndex > 8) {
         imageIndex = 1;
     }
     SlideShow(imageIndex);
     timer.Interval = new TimeSpan(0, 0, 4);
 }
開發者ID:sgoo,項目名稱:se306p2,代碼行數:9,代碼來源:homepage.xaml.cs

示例10: Matches

 public override bool Matches(object targetElement, InputEventArgs inputEventArgs)
 {
     var action = GetExtendedMouseAction(inputEventArgs);
     if (action != null && extendedMouseAction == action.Value)
     {
         return Modifiers == Keyboard.Modifiers;
     }
     return base.Matches(targetElement, inputEventArgs);
 }
開發者ID:NightmareX1337,項目名稱:lfs,代碼行數:9,代碼來源:ExtendedMouseGesture.cs

示例11: PushInput

        public StagingAreaInputItem PushInput(InputEventArgs input,
                                              StagingAreaInputItem promote) // Note: this should be a bool, and always use the InputItem available on these args. 
        {
            if(!_allowAccessToStagingArea)
            {
                throw new InvalidOperationException(SR.Get(SRID.NotAllowedToAccessStagingArea)); 
            }
 
            return this.UnsecureInputManager.PushInput(input, promote); 
        }
開發者ID:sjyanxin,項目名稱:WPFSource,代碼行數:10,代碼來源:ProcessInputEventArgs.cs

示例12: LayoutRoot_TouchDown

 private void LayoutRoot_TouchDown(object sender, InputEventArgs e)
 {
     var yi = DataContext as YearItem;
     if (yi == null)
         return;
     yi.Orientation = e.Device.GetOrientation(null) + 90;
     yi.Position = e.Device.GetPosition(null);
     yi.Position.X -= 100;
     yi.Position.Y -= 50;
     (DataContext as YearItem).ShowText = true;
 }
開發者ID:smalice,項目名稱:TechnologyVision,代碼行數:11,代碼來源:TechnoControl.xaml.cs

示例13: badgeDoubleTap

        public void badgeDoubleTap(object sender, InputEventArgs e)
        {
            RaiseEvent(new RoutedEventArgs(RequestLargeViewEvent));
            if(e!=null)
                e.Handled = true;
            //var ap = DataContext as ArgPoint;
            //var id = ap.Id;
            //var zoomedAp = DbCtx.Get().ArgPoint.FirstOrDefault(ap0 => ap0.Id == id);

            //var zoom = new ZoomWindow(zoomedAp);
            //zoom.ShowDialog();
        }
開發者ID:gdlprj,項目名稱:duscusys,代碼行數:12,代碼來源:Badge4.xaml.cs

示例14: Matches

 public override bool Matches(object targetElement, InputEventArgs inputEventArgs)
 {
     if (m_hackMode)
     {
         KeyEventArgs args = inputEventArgs as KeyEventArgs;
         return args != null && Keyboard.Modifiers == ModifierKeys.None && this.Key == args.Key;
     }
     else
     {
         return base.Matches(targetElement, inputEventArgs);
     }
 }
開發者ID:tomba,項目名稱:dwarrowdelf,代碼行數:12,代碼來源:ClientCommands.cs

示例15: Matches

        public override bool Matches(object targetElement, InputEventArgs inputEventArgs)
        {
            // Don't execute input binding in case focus is on a textbox
            if ((inputEventArgs.Device.Target is TextBoxBase || inputEventArgs.Device.Target is WebBrowser)
                && !(modifiers == ModifierKeys.Control || modifiers == ModifierKeys.Alt))
                return false;

            var args = inputEventArgs as KeyEventArgs;

            if ((args == null) || !IsDefinedKey(args.Key))
            {
                return false;
            }

            if (_currentKeyIndex != 0 && ((DateTime.Now - _lastKeyPress) > _maximumDelayBetweenKeyPresses))
            {
                //took too long to press next key so reset
                _currentKeyIndex = 0;
                return false;
            }

            //the modifier only needs to be held down for the first keystroke, but you could also require that the modifier be held down for every keystroke
            if (_currentKeyIndex == 0 && Modifiers != Keyboard.Modifiers)
            {
                //wrong modifiers
                _currentKeyIndex = 0;
                return false;
            }

            if (_keys[_currentKeyIndex] != args.Key)
            {
                //wrong key
                _currentKeyIndex = 0;
                return false;
            }

            ++_currentKeyIndex;

            if (_currentKeyIndex != _keys.Count)
            {
                //still matching
                _lastKeyPress = DateTime.Now;
                inputEventArgs.Handled = true;
                return false;
            }

            //match complete
            _currentKeyIndex = 0;
            return true;
        }
開發者ID:Klaudit,項目名稱:inbox2_desktop,代碼行數:50,代碼來源:MultiKeyGesture.cs


注:本文中的System.Windows.Input.InputEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。