Пример #1
0
            // initializes and actualizes new instance
            public static InputInfo Create()
            {
                var result = new InputInfo();

                result.Update();

                return result;
            }
Пример #2
0
            // initializes and actualizes new instance
            public static InputInfo Create()
            {
                var result = new InputInfo();

                result.Update();

                return(result);
            }
Пример #3
0
 // starts user input polling
 public void Start()
 {
     lock (timerLock)
     {
         initialInfo.Update();
         actualInfo = (InputInfo)initialInfo.Clone();
         timer.Start();
     }
 }
        protected virtual void Update()
        {
            if (!IsActive() || !IsInteractable() || InputBind == null)
            {
                return;
            }

            InputBind.Update();

            _stateTransition();

            _downHandle();

            _holdHandle();

            _clickEventHandle();

            _upHandle(false);
        }
Пример #5
0
        // user input polling
        private void timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            lock (timerLock)
            {
                actualInfo.Update();

                // compare user input info
                if (!initialInfo.Equals(actualInfo))
                {
                    timer.Stop();

                    var handler = Changed;
                    if (handler != null)
                    {
                        // fire changed event
                        handler(this, new InputChangedEventArgs
                        {
                            Initial = initialInfo.DateTime,
                            Changed = actualInfo.DateTime
                        });
                    }
                }
            }
        }