private void TaskDescriptionsExplorer_Load(object sender, EventArgs e)
        {
            treeView.Font     = (Font)AppContext.Current.SettingsProvider.Get("GeneralFont", Font);
            propertyGrid.Font = (Font)AppContext.Current.SettingsProvider.Get("GeneralFont", Font);

            //clear the context variable
            AppContext.Current.SettingsProvider.Set(
                "SelectedTaskDescription",
                TaskDescription.Empty,
                PersistHint.AcrossSessions);

            TaskActivity currentTaskactivity =
                (TaskActivity)AppContext.Current.SettingsProvider.Get("CurrentActivity", TaskActivity.Empty);

            if (currentTaskactivity.IsNotEmpty())
            {
                _currentTaskDescription = currentTaskactivity.TaskDescription;
            }

            // Set Owner Draw Mode to Text
            if ((null == Site) || (!Site.DesignMode))
            {
                if ((bool)AppContext.Current.SettingsProvider.Get("Advanced Draw on Descriptions Tree", true))
                {
                    treeView.DrawMode = TreeViewDrawMode.OwnerDrawText;
                }
            }
            ReBuildTree(AppContext.Current.TaskDescriptionsProvider.TaskDescriptions);

            buttonUse.Visible = !(bool)AppContext.Current.SettingsProvider.Get("HideUseButton", false);

            Activate();
        }
Example #2
0
        private void buttonOk_Click(object sender, EventArgs e)
        {
            TaskActivity currentActivity = AppContext.Current.CurrentActivity;

            if (currentActivity.IsNotEmpty())
            {
                currentActivity.Remarks = textBoxRemark.Text;
            }
            this.Close();
        }
        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.";
            }
        }
        private void contextMenuStripStatusBar_Opening(object sender, CancelEventArgs e)
        {
            TaskActivity currentAvtivity =
                (TaskActivity)_engine.SettingsProvider.Get("CurrentActivity", TaskActivity.Empty);

            if (currentAvtivity.IsNotEmpty())
            {
                toolStripTextBoxNewStart.TextBox.Text = currentAvtivity.StartDate.ToShortTimeString();
                toolStripTextBoxNewStart.Enabled      = true;
                commitToolStripMenuItem.Enabled       = true;
            }
            else
            {
                toolStripTextBoxNewStart.Enabled = false;
                commitToolStripMenuItem.Enabled  = false;
            }
        }
Example #5
0
        public InstantNotesDialog()
        {
            InitializeComponent();
            TaskActivity currentActivity = AppContext.Current.CurrentActivity;

            if (currentActivity.IsNotEmpty())
            {
                textBoxRemark.Text    = currentActivity.Remarks;
                textBoxRemark.Enabled = true;
                textBoxRemark.Focus();
            }
            else
            {
                textBoxRemark.Text    = "no currently task";
                textBoxRemark.Enabled = false;
            }
        }
        private void commitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            TaskActivity currentAvtivity =
                (TaskActivity)_engine.SettingsProvider.Get("CurrentActivity", TaskActivity.Empty);

            if (currentAvtivity.IsNotEmpty())
            {
                try
                {
                    DateTime change =
                        DateTime.Parse(currentAvtivity.StartDate.ToShortDateString() +
                                       " " + toolStripTextBoxNewStart.TextBox.Text);
                    currentAvtivity.StartDate = change;
                    _engine.SettingsProvider.Set("CurrentActivity", currentAvtivity, PersistHint.AcrossSessions);
                }
                catch (FormatException fe)
                {
                    Trace.TraceError("TaskActivitiesExplorer:commitToolStripMenuItem_Click[{0}]", fe.Message);
                    //ignore this error, the user has made a mistake
                }
            }
        }