当前位置: 首页>>代码示例>>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;未经允许,请勿转载。