Esempio n. 1
0
 //добавление задания
 private void buttonSessionsForm_Click(object sender, EventArgs e)
 {
     AddTask form = new AddTask(null, this);
     form.ShowDialog(this);
     if (dRes == DialogResult.OK)
     {
         saved = false;
         buttonSessionsCancel.Enabled = true;
         buttonSessionsCancel.Enabled = true;
         bufferSessions[currentSession].tasks.Add(tTask);
         UpdateTaskListView();
         if (!checkBoxSessionsPaternsAuto.Checked)
         {
             if (bufferSessions[currentSession].tasks.Count > 1 &&
                 bufferSessions[currentSession].patterns.Count < bufferSessions[currentSession].tasks.Count - 1)
             {
                 bufferSessions[currentSession].patterns.Add(new Pattern(10, 0));
                 UpdatePatternListView();
             }
         }
         textBoxSessionDuration.Text = SessionLength().ToString();
     }
 }
Esempio n. 2
0
 //изменение задания
 private void toolStripMenuChanged_Click(object sender, EventArgs e)
 {
     if (listViewSessionsTasks.SelectedIndices.Count != 0)
     {
         AddTask form = new AddTask(bufferSessions[currentSession].tasks[currentTask], this);
         form.ShowDialog(this);
         if (dRes == DialogResult.OK)
         {
             bufferSessions[currentSession].tasks[currentTask] = tTask;
             saved = false;
             buttonSessionsCancel.Enabled = true;
             buttonSessionsCancel.Enabled = true;
             UpdateTaskListView();
             textBoxSessionDuration.Text = SessionLength().ToString();
         }
     }
 }