Example #1
0
        private void MainForm_Resize(object sender, EventArgs e)
        {
            if (WindowState == FormWindowState.Minimized)
            {
                Hide();

                MatchItem matchNext = matchProvider.GetNextMatch();

                string tipText = Strings.NoMatches;
                if (matchNext != null)
                {
                    tipText = matchNext.getDescription();
                }

                niTray.ShowBalloonTip(500, Application.ProductName, tipText, ToolTipIcon.Info);
            }
        }
Example #2
0
        private void niTray_MouseMove(object sender, MouseEventArgs e)
        {
            MatchItem matchNext = matchProvider.GetNextMatch();

            if (matchNext != null)
            {
                TimeSpan delay       = matchNext.DateBegin - DateTime.Now;
                string   description = matchNext.getDescription();
                int      minutes     = delay.Minutes + (delay.Seconds > 30 ? 1 : 0);
                string   through     = Strings.Through + delay.Days.ToString("00") + ":" + delay.Hours.ToString("00") + ":" + minutes.ToString("00");
                string   tipText     = (description + "\n" + through);

                niTray.Text = tipText.Length < 64 ? tipText : description;
            }
            else
            {
                niTray.Text = Strings.NoMatches;
            }
        }