Exemplo n.º 1
0
        protected void HandleTaskFinished(object sender, ITaskItem task, TTaskResult Result)
        {
            tbOutput.Text += " 运行结果: " + Result + "\r\n";
            tbOutput.Text += " " + task.ToString() + "\r\n";

            try
            {
                if ((task is TaskItem_CheckProj_CheckCsprojFiles))
                {
                    if ((task as TaskItem_CheckProj_CheckFiles).DismatchList.EnumerableAny())
                    {
                        (task as TaskItem_CheckProj_CheckFiles).DismatchList.ForEach(f => {
                            if (!string.IsNullOrEmpty(f?.PathMainline?.FullName))
                            {
                                listBoxMainlineCsproj.Items.Add(f?.PathMainline?.FullName);
                            }
                        });
                        (task as TaskItem_CheckProj_CheckFiles).DismatchList.ForEach(f => {
                            if (!string.IsNullOrEmpty(f?.PathBranch?.FullName))
                            {
                                listBoxBranchCsproj.Items.Add(f.PathBranch?.FullName);
                            }
                        });
                    }
                }
                else if ((task is TaskItem_CheckProj_CheckFiles))
                {
                    if ((task as TaskItem_CheckProj_CheckFiles).DismatchList.EnumerableAny())
                    {
                        (task as TaskItem_CheckProj_CheckFiles).DismatchList.ForEach(f => {
                            if (!string.IsNullOrEmpty(f?.PathMainline?.FullName))
                            {
                                listBoxMainlineFiles.Items.Add(f?.PathMainline?.FullName);
                            }
                        });
                        (task as TaskItem_CheckProj_CheckFiles).DismatchList.ForEach(f => {
                            if (!string.IsNullOrEmpty(f?.PathBranch?.FullName))
                            {
                                listBoxBranchFiles.Items.Add(f.PathBranch?.FullName);
                            }
                        });
                    }
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
                tbOutput.Text += "\r\n";
                tbOutput.Text += " 处理任务结果发生异常: " + ex.Message + "\r\n";
                tbOutput.Text += " 调用堆栈: " + ex.StackTrace + "\r\n";
            }

            tbOutput.Text += "> 任务[" + task.GetType().Name + "]结束\r\n\r\n";
        }
Exemplo n.º 2
0
        private (GraphNode <Key, FormNode>, Key) AddTaskQuestion(Graph <Key, FormNode> graph, string taskId, ITaskItem taskQuestionPage, IEnumerable <int> repeatIndices)
        {
            var isTaskQuestionGhost = taskQuestionPage.GetType() == typeof(TaskQuestionGhost);

            var key = Key.ForTaskItemPage(taskId, taskQuestionPage.Id, repeatIndices);

            var node = isTaskQuestionGhost ?
                       new GraphNode <Key, FormNode>(key, new TaskQuestionGhost(taskQuestionPage.Id)) :
                       new GraphNode <Key, FormNode>(key, new TaskQuestionPageFormNode(taskId, taskQuestionPage.Id, repeatIndices));

            graph.AddNode(node);
            var nextKey = taskQuestionPage.NextPageId != null?Key.ForTaskItemPage(taskId, taskQuestionPage.NextPageId, repeatIndices) : null;

            return(node, nextKey);
        }
Exemplo n.º 3
0
 protected void HandleTaskBegin(object sender, ITaskItem task)
 {
     tbOutput.Text += "> 任务[" + task.GetType().Name + "]开始:\r\n";
 }