Esempio n. 1
0
        /// <summary>
        ///     Releases all resources used by the <see cref="Component"/>.
        /// </summary>
        protected virtual void Dispose(bool disposing)
        {
            if (!Disposed)
            {
                if (disposing)
                {
                    Timer.Elapsed -= Timer_Elapsed;

                    // if an action is staged, invoke it to 'flush'
                    if (FlushOnDispose)
                    {
                        Staged?.Invoke();
                    }

                    Staged = null;
                    Timer.Dispose();
                }

                Disposed = true;
            }
        }
Esempio n. 2
0
 private void Timer_Elapsed(object sender, EventArgs args)
 {
     Staged?.Invoke();
     Staged = null;
 }