Esempio n. 1
0
        public override void Destroy()
        {
            // If there is a timeout that hasn't been invoked yet, run it before closing the dialog.
            if (event_delay_timeout_id != 0)
            {
                GLib.Source.Remove(event_delay_timeout_id);
                timeout_func.Invoke();
            }

            base.Destroy();
        }
Esempio n. 2
0
        protected override void Dispose(bool disposing)
        {
            // If there is a timeout that hasn't been invoked yet, run it before closing the dialog.
            if (disposing && event_delay_timeout_id != 0)
            {
                GLib.Source.Remove(event_delay_timeout_id);
                timeout_func?.Invoke();
            }

            base.Dispose(disposing);
        }
Esempio n. 3
0
        private void DelayedUpdate(GLib.TimeoutHandler handler)
        {
            if (event_delay_timeout_id != 0)
            {
                GLib.Source.Remove(event_delay_timeout_id);
                if (handler != timeout_func)
                {
                    timeout_func.Invoke();
                }
            }

            timeout_func           = handler;
            event_delay_timeout_id = GLib.Timeout.Add(event_delay_millis, () => {
                event_delay_timeout_id = 0;
                timeout_func.Invoke();
                timeout_func = null;
                return(false);
            });
        }