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(); }
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); }
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); }); }