private void UpdateStatusBarText()
        {
            TaskActivity current = _engine.SettingsProvider.Get("CurrentActivity", TaskActivity.Empty) as TaskActivity;

            if (current.IsNotEmpty())
            {
                toolStripStatusLabel.Text = current.ToSummaryString().Replace("\r\n", " ");
            }
            else
            {
                toolStripStatusLabel.Text = "There is no activity running.";
            }
        }
        /// <summary>
        /// Builds the current activity.
        /// </summary>
        private void BuildCurrentActivity()
        {
            TaskActivity activity = AppContext.Current.CurrentActivity;

            if (activity != null && !activity.IsEmpty())
            {
                string message = activity.ToSummaryString().Replace("\r\n", " ");
                int    index   = message.IndexOf("on the");
                if (index != -1)
                {
                    this._textBoxCurrentTask.Text = message.Substring(0, index);
                }
                else
                {
                    this._textBoxCurrentTask.Text = message;
                }
            }
        }
Ejemplo n.º 3
0
        private void ShowCurrentActivity()
        {
            TaskActivity currentActivity = AppContext.Current.CurrentActivity;

            // TODO: There should also be a format type on ToString for TaskActivity (ala GUID)
            if (currentActivity != null)
            {
                string message = currentActivity.ToSummaryString().Replace("\r\n", " ");
                int    index   = message.IndexOf("on the");
                if (index != -1)
                {
                    toolStripStatusLabelMain.Text = message.Substring(0, index);
                }
                else
                {
                    toolStripStatusLabelMain.Text = message;
                }
            }
            else
            {
                toolStripStatusLabelMain.Text = "Current Activity: None";
            }
        }