private void Main_FormClosing(object eventSender, FormClosingEventArgs eventArgs)
{
if (eventArgs.CloseReason == CloseReason.UserClosing)
{
if (!this.NotifyIcon.Visible)
{
if (this.WindowState != FormWindowState.Minimized)
{
this.WindowState = FormWindowState.Minimized;
eventArgs.Cancel = true;
}
}
else
{
OsUtils.TrayAnimate(this, true);
this.Visible = false;
eventArgs.Cancel = true;
if (!Settings.ShownTrayBalloon)
{
this.NotifyIcon.BalloonTipIcon = ToolTipIcon.Info;
this.NotifyIcon.BalloonTipText = "Radio Downloader will continue to run in the background, so that it can download your subscriptions as soon as they become available." + Environment.NewLine + "Click here to hide this message in future.";
this.NotifyIcon.BalloonTipTitle = "Radio Downloader is still running";
this.NotifyIcon.ShowBalloonTip(30000);
}
}
}
}