private void ToastNotifier_Click(object sender, EventArgs e)
{
EventHandler handler = ToastClicked;
ToastClicked = null; // handle only one click message. (Linux posts two if link clicked, one for Toast window in general.)
if (handler != null)
handler(this, e);
// We may still have a message pending for the sender even though it has already been disposed.
// This would cause a System.ObjectDisposedException shortly if we call Close() directly from
// here, so we add a method to close this ToastNotifier to the Application.Idle processor (which
// won't fire until all of the current pending messages have been handled). See BL-3285.
Application.Idle += CloseThisLater;
}