Example #1
0
        private void TasksCheckedListBox_SelectedIndexChanged(object sender, EventArgs e)//freroam tasks
        {
            try
            {
                if (TasksCheckedListBox.SelectedIndex != -1)
                {
                    string key = TasksCheckedListBox.SelectedItem.ToString();
                    switch (Tasks.ContainsKey(key))
                    {
                    case true:
                        DescriptionRichTextBox.LoadFile(Tasks[key].RTFPath, RichTextBoxStreamType.RichText);
                        //DescriptionRichTextBox.AppendText("\n******\nSaved at: " + Tasks[key].TimeOfCreated.ToShortDateString() +
                        //"\nTarget date picked: " + Tasks[key].TimeTarget.ToShortDateString());
                        break;

                    case false:
                        MessageBox.Show("Task didnt found in TasksList. \nTIP: try to load previously saved tasks");
                        //DescriptionRichTextBox.LoadFile(UsersRTFPath + @"\" + key + ".rtf", RichTextBoxStreamType.RichText
                        break;
                    }
                }
                else
                {
                    DescriptionRichTextBox.Clear();
                }
            }
            catch (Exception ex)
            {
                //MessageBox.Show(ex.ToString());
                DescriptionRichTextBox.Clear();
                InWorkTxtBox.Text = (ex.ToString());
            }
        }