Esempio n. 1
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
                        });
                    }
                }
            }
        }