public GroupRunner(ref Tuple<GroupDetails, TaskCollection> groupTuppleObject) {
     InitializeComponent();
     GroupTuppleObject = groupTuppleObject;
     TaskCollectionObject = GroupTuppleObject.Item2;
     TaskCount = TaskCollectionObject.TaskList.Count;
     GetTaskDetailsDelegate = new TaskDetail(GetTaskDetails);
     GroupNameLabel.Text = GroupTuppleObject.Item1.Name;
     Text = "Group Runner : " + GroupTuppleObject.Item1.Name;
     GroupIDLabel.Text = GroupTuppleObject.Item1.ID.ToString();
     VerboseComboBox.SelectedIndex = 1;
     if (TaskCount > 0) {
         TasksLoadedCount = 0;
         foreach (Task TaskObject in TaskCollectionObject.TaskList)
             ThreadPool.QueueUserWorkItem(new WaitCallback(PopulateTasks), TaskObject);
     }
 }
        public GroupForm() {
            InitializeComponent();
            GroupExisting = false;
            GroupSaved = false;
            TaskCollectionObject = new TaskCollection();
            GroupButtonObject = null;

            this.Text = "Create Group";
            CreateSaveGroupButton.Text = "Create Group";
            CancelCloseButton.Text = "Cancel";
            PathChangeEnabled(false);
            GroupID = Options.LastGroupID + 1;
            GroupIDLabel.Text = "ID : " + GroupID.ToString();
            EnabledComboBox.SelectedIndex = 0;
            OccurrenceComboBox.SelectedIndex = 0;
            DayComboBox.SelectedIndex = 0;
            IntervalComboBox.SelectedIndex = 0;
            DeleteGroup.Visible = false;
        }
 public void LoadGroupData() {
     GroupDetailsObject = GroupTuppleObject.Item1;
     DeleteGroup.Visible = true;
     this.Text = "Group : " + GroupDetailsObject.Name;
     NameTextBox.Text = GroupDetailsObject.Name;
     PathTextBox.Text = GroupDetailsObject.Path;
     GroupFileDialog.InitialDirectory = System.IO.Path.GetDirectoryName(GroupDetailsObject.Path);
     GroupFileDialog.FileName = System.IO.Path.GetFileName(GroupDetailsObject.Path);
     if (GroupDetailsObject.Enabled) EnabledComboBox.SelectedIndex = 0;
     else EnabledComboBox.SelectedIndex = 1;
     switch (GroupDetailsObject.ScheduleOccurrence) {
         case "weekly":
             OccurrenceComboBox.SelectedIndex = 0;
             break;
         case "daily":
             OccurrenceComboBox.SelectedIndex = 1;
             break;
         case "interval":
             OccurrenceComboBox.SelectedIndex = 2;
             break;
     }
     DayComboBox.SelectedIndex = GroupDetailsObject.ScheduleDay - 1;
     HourTextBox.Text = GroupDetailsObject.ScheduleTime.Hour.ToString();
     MinuteTextBox.Text = GroupDetailsObject.ScheduleTime.Minute.ToString().PadLeft(2, '0');
     IntervalTextBox.Text = GroupDetailsObject.ScheduleInterval.ToString();
     CreateSaveGroupButton.Text = "Save Group";
     CancelCloseButton.Text = "Close";
     IntervalComboBox.SelectedIndex = 0;
     GroupID = GroupDetailsObject.ID;
     GroupIDLabel.Text = "ID : " + GroupID.ToString();
     TasksLoadedCount = 0;
     TaskCollectionObject = GroupTuppleObject.Item2;
     NumberOfTasks = TaskCollectionObject.TaskList.Count;
     TotalTasksLabel.Text = "Total Tasks : " + NumberOfTasks.ToString();
     foreach (Task TaskObject in TaskCollectionObject.TaskList)
         ThreadPool.QueueUserWorkItem(new WaitCallback(PopulateTasks), TaskObject);
 }
 public void InitializeWithoutTimer(string path) {
     try {
         GroupWithoutTimerList = new List<Tuple<GroupDetails, TaskCollection>>();
         XmlDocument XMLDoc = new XmlDocument();
         XMLDoc.Load(path);
         if (XMLDoc.DocumentElement != null) {
             int GroupID;
             string GroupPath;
             XmlNode GroupScheduleNode;
             TaskCollection TaskCollectionObject;
             foreach (XmlNode GroupElement in XMLDoc.DocumentElement.SelectNodes("group")) {
                 GroupPath = GroupElement.SelectSingleNode("path").InnerText;
                 GroupScheduleNode = GroupElement.SelectSingleNode("schedule");
                 GroupID = Convert.ToInt32(GroupElement.SelectSingleNode("id").InnerText);
                 TaskCollectionObject = new TaskCollection(@GroupPath, GroupID);
                 GroupWithoutTimerList.Add(new Tuple<GroupDetails, TaskCollection>(new GroupDetails(GroupID,
                     GroupElement.SelectSingleNode("name").InnerText,
                     GroupPath,
                     GroupScheduleNode.SelectSingleNode("occurrence").InnerText.ToLower(),
                     Convert.ToInt16(GroupScheduleNode.SelectSingleNode("day").InnerText),
                     Convert.ToInt32(GroupScheduleNode.SelectSingleNode("interval").InnerText),
                     DateTime.Parse(GroupScheduleNode.SelectSingleNode("time").InnerText),
                     Convert.ToBoolean(GroupElement.SelectSingleNode("enabled").InnerText)), TaskCollectionObject));
             }
         }
     } catch (Exception ex) {
         Log.Write("GroupCollection::Initialize() Error -> " + ex.Message);
     }
 }