Example #1
0
        private void GetTasks()
        {
            // find all checkboxes in the window
            IEnumerable <CheckBox> myBoxes = FindVisualChildren <CheckBox>(this);

            List <Task> tList = new List <Task>();

            foreach (CheckBox cb in myBoxes)
            {
                if (cb.Name != "checkBoxTask")
                {
                    continue;
                }

                string taskDescription = string.Empty;
                if (cb.IsChecked == true)
                {
                    taskDescription = cb.Content.ToString().Replace("System.Windows.Controls.ContentControl: ", "");
                    tList.Add(new Task(taskDescription, true));
                    //LogTasks.Add(new CheckList(selectedVersion, machineType, (new Task(taskDescription, true), true));
                }
                else
                {
                    taskDescription = cb.Content.ToString().Replace("System.Windows.Controls.ContentControl: ", "");
                    tList.Add(new Task(taskDescription, false));
                }
            }
            LogTasks.Add(new CheckList(SelectedVersion, machineType, tList));
        }
Example #2
0
 private void CompleteLogTask(string version)
 {
     if (ChecklistCompleted(version))
     {
         List <Task> tList = new List <Task>();
         foreach (CheckedListItem <Task> item in list.GenerateList(version, machineType))
         {
             tList.Add(new Task(item.Item.Name, true));
         }
         LogTasks.Add(new CheckList(version, machineType, tList));
     }
 }