/// <summary> /// Show the current active task in a boaloon tip /// </summary> private void ShowCurrentStatus() { TaskActivity current = Engine.CurrentActivity; string message; if ((current.IsNotEmpty()) && (current.TaskDescription.IsNotEmpty())) { message = current.ToSummaryString(); } else { message = @"The TaskClerk system is ready and idle. There is currently no Task Activity running. Use the help to discover how you can start and stop Tasks."; } Engine.UIProvider.ShowNagMessage(message); }
/// <summary> /// updates the notify icons tool tip. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="BritishMicro.TaskClerk.TaskActivityEventArgs"/> instance containing the event data.</param> void UpdateNotifyToolTip(object sender, TaskActivityEventArgs e) { TaskActivity current = e.TaskActivity; if (current.IsNotEmpty() && !current.TaskDescription.IsEvent) { if (current.TaskDescription.IsNotEmpty() & current.TaskDescription.IsEvent == false) { int MAXSIZEOFNOTIFYTEXT = 63; string notifyToolTip = string.Format(CultureInfo.CurrentCulture, "{0}:{1}", Resources.NotifyToolTip, current.TaskDescription.Name); notifyToolTip = notifyToolTip.Substring( 0, (notifyToolTip.Length <= MAXSIZEOFNOTIFYTEXT ? notifyToolTip.Length : MAXSIZEOFNOTIFYTEXT)); notifyIcon.Text = notifyToolTip; } } else { notifyIcon.Text = Resources.NotifyToolTip; } }
/// <summary> /// setup the nag message for a task /// </summary> /// <param name="activity"></param> private void SetupNag(TaskActivity activity) { nagtimer.Enabled = false; if ((activity.IsNotEmpty()) & (activity.TaskDescription.NoNagMinutes > 0)) { int MILLISECOND_MULTIPLIER = 60*1000; nagtimer.Interval = activity.TaskDescription.NoNagMinutes*MILLISECOND_MULTIPLIER; nagtimer.Enabled = true; } }