Beispiel #1
0
        private void listViewTasks_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var selectedItem = (TaskData)listViewTasks.SelectedItem;

            if (selectedItem != null)
            {
                var path = treeViewMachinesAndTasksHandler.GetNodePath() + "\\" + selectedItem.Name + ".my";
                if (!selectedItem.ImageSource.Contains("Folder"))
                {
                    var taskOptionsDialog = new TaskOptions();
                    taskOptionsDialog.path     = path;
                    taskOptionsDialog.nodePath = treeViewMachinesAndTasksHandler.GetNodePath();
                    taskOptionsDialog.clients  = listViewMachinesAndTasksHandler.clients;
                    taskOptionsDialog.ExecutedTasksHandlers = ExecutedTasksHandlers;
                    foreach (TaskData item in listViewTasks.Items)
                    {
                        if (item.Name != selectedItem.Name)
                        {
                            taskOptionsDialog.Names.Add(item.Name);
                        }
                    }
                    taskOptionsDialog.ShowDialog();
                    if (taskOptionsDialog.executed)
                    {
                        RunTask(taskOptionsDialog);
                    }
                    listViewMachinesAndTasksHandler.Refresh();
                }
                else
                {
                    treeViewMachinesAndTasksHandler.SetTreeNode(selectedItem.Name);
                }
            }
        }
Beispiel #2
0
        private void MenuItemTaskNew_Click(object sender, RoutedEventArgs e)
        {
            var taskOptionsDialog = new TaskOptions();

            taskOptionsDialog.path     = "";
            taskOptionsDialog.nodePath = treeViewMachinesAndTasksHandler.GetNodePath();
            taskOptionsDialog.clients  = listViewMachinesAndTasksHandler.clients;
            taskOptionsDialog.ExecutedTasksHandlers = ExecutedTasksHandlers;
            foreach (TaskData item in listViewTasks.Items)
            {
                taskOptionsDialog.Names.Add(item.Name);
            }
            taskOptionsDialog.ShowDialog();
            if (taskOptionsDialog.executed)
            {
                RunTask(taskOptionsDialog);
            }
            listViewMachinesAndTasksHandler.Refresh();
        }
Beispiel #3
0
        private void RunTask(TaskOptions dialog)
        {
            ExecutedTaskData executedTask = new ExecutedTaskData();

            executedTask.Name         = dialog.taskData.Name;
            executedTask.Status       = "Images/Progress.ico";
            executedTask.Started      = dialog.taskData.LastExecuted;
            executedTask.Finished     = "NONE";
            executedTask.Clients      = dialog.taskData.TargetComputers.Count.ToString();
            executedTask.Done         = "0";
            executedTask.Failed       = "0";
            executedTask.MachineGroup = dialog.taskData.MachineGroup;
            executedTask.taskData     = dialog.taskData;
            ExecutedTaskHandler taskHandler = new ExecutedTaskHandler(executedTask, ipAddresses, listViewComputersProgressAll, listViewComputersProgressSelected, listViewTaskDetailsProgress);

            ExecutedTasksHandlers.Add(taskHandler);
            taskHandler.handlers        = ExecutedTasksHandlers;
            taskHandler.listViewHandler = listViewTaskDetailsHandler;
            taskHandler.clients         = listViewMachinesAndTasksHandler.clients;
            Thread taskHandlerThread = new Thread(taskHandler.Start);

            taskHandlerThread.Start();
        }