示例#1
0
        private void OnAddList_Click()
        {
            TaskList cur = new TaskList();

            //if this is a child of any other taskList
            if (TreeHistory.Count > 0)
            {
                cur.Parent = ((TaskList)TreeHistory[TreeHistory.Count - 1]).TaskListNum;
            }
            else
            {
                cur.Parent = 0;
                if (tabContr.SelectedIndex == 2)               //by date
                {
                    cur.DateTL   = cal.SelectionStart;
                    cur.DateType = TaskDateType.Day;
                }
                else if (tabContr.SelectedIndex == 3)               //by week
                {
                    cur.DateTL   = cal.SelectionStart;
                    cur.DateType = TaskDateType.Week;
                }
                else if (tabContr.SelectedIndex == 4)               //by month
                {
                    cur.DateTL   = cal.SelectionStart;
                    cur.DateType = TaskDateType.Month;
                }
            }
            if (tabContr.SelectedIndex == 1)           //repeating
            {
                cur.IsRepeating = true;
            }
            FormTaskListEdit FormT = new FormTaskListEdit(cur);

            FormT.IsNew = true;
            FormT.ShowDialog();
            FillMain();
        }
示例#2
0
 private void OnEdit_Click()
 {
     if (clickedI < TaskListsList.Length)             //is list
     {
         FormTaskListEdit FormT = new FormTaskListEdit(TaskListsList[clickedI]);
         FormT.ShowDialog();
     }
     else              //task
     {
         FormTaskEdit FormT
             = new FormTaskEdit(TasksList[clickedI - TaskListsList.Length]);
         FormT.ShowDialog();
         if (FormT.GotoType != TaskObjectType.None)
         {
             GotoType   = FormT.GotoType;
             GotoKeyNum = FormT.GotoKeyNum;
             OnGoToChanged();
             //DialogResult=DialogResult.OK;
             return;
         }
     }
     FillMain();
 }
示例#3
0
		private void Edit_Clicked() {
			if(clickedI < TaskListsList.Count) {//is list
				FormTaskListEdit FormT=new FormTaskListEdit(TaskListsList[clickedI]);
				FormT.ShowDialog();
				FillGrid();
			}
			else {//task
				FormTaskEdit FormT=new FormTaskEdit(TasksList[clickedI-TaskListsList.Count],TasksList[clickedI-TaskListsList.Count].Copy());
				FormT.Closing+=new CancelEventHandler(TaskGoToEvent);
				FormT.Show();//non-modal
			}
		}
示例#4
0
		private void AddList_Clicked() {
			if(tabContr.SelectedTab==tabUser && TreeHistory.Count==0) {//trunk of user tab
				MsgBox.Show(this,"Not allowed to add a task list to the trunk of the user tab.  Either use the subscription feature, or add it to a child list.");
				return;
			}
			if(tabContr.SelectedTab==tabNew) {//new tab
				MsgBox.Show(this,"Not allowed to add items to the 'New' tab.");
				return;
			}
			TaskList cur=new TaskList();
			//if this is a child of any other taskList
			if(TreeHistory.Count>0) {
				cur.Parent=TreeHistory[TreeHistory.Count-1].TaskListNum;
			}
			else {
				cur.Parent=0;
				if(tabContr.SelectedTab==tabDate) {
					cur.DateTL=cal.SelectionStart;
					cur.DateType=TaskDateType.Day;
				}
				else if(tabContr.SelectedTab==tabWeek) {
					cur.DateTL=cal.SelectionStart;
					cur.DateType=TaskDateType.Week;
				}
				else if(tabContr.SelectedTab==tabMonth) {
					cur.DateTL=cal.SelectionStart;
					cur.DateType=TaskDateType.Month;
				}
			}
			if(tabContr.SelectedTab==tabRepeating) {
				cur.IsRepeating=true;
			}
			FormTaskListEdit FormT=new FormTaskListEdit(cur);
			FormT.IsNew=true;
			FormT.ShowDialog();
			FillGrid();
		}