コード例 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string category = txbCategory.Text;
            string desc     = txbItem.Text;

            DateTime dates = DateTime.Now;

            ToDo.Levels level;
            switch (cmbLevel.SelectedItem.ToString())
            {
            case "Not Important":
                level = ToDo.Levels.NotImportant;
                break;

            case "Important":
                level = ToDo.Levels.Important;
                break;

            default:
                level = ToDo.Levels.Urgent;
                break;
            }
            ToDo toDo = new ToDo(category, desc, dates, level);

            ListUtil.toDoList.Add(toDo);

            TextFileUtil.writeToFile(ListUtil.toDoList);
            loadListBox();
        }
コード例 #2
0
 private void frmToDo_Load(object sender, EventArgs e)
 {
     ListUtil.toDoList = TextFileUtil.readFromFile();
     loadListBox();
 }