Exemplo n.º 1
0
        private void ResultProcessing(String result)
        {
            string       aLine     = null;
            StringReader strReader = new StringReader(result);

            while (true)
            {
                aLine = strReader.ReadLine();
                if (aLine != null)
                {
                    //Logger(aLine);
                    StdOutCmdLine cmdLine = StdOutCmdLine.FromString(aLine);
                    if (cmdLine != null)
                    {
                        ReportProgress(cmdLine.Tag);
                        if (CmdOutputTag.RESULT.Equals(cmdLine.Tag))
                        {
                            StopProgressBarAnimation(false);
                            ReportProgress(cmdLine.Tag);

                            Data_ResultJson result_json = JsonConvert.DeserializeObject <Data_ResultJson>(cmdLine.Data);
                            if (result_json != null)
                            {
                                showResult(result_json);
                            }
                        }
                    }
                }
                else
                {
                    break;
                }
            }
        }
Exemplo n.º 2
0
        private void showResult(Data_ResultJson ResultJson)
        {
            Dispatcher.BeginInvoke(new Action(delegate
            {
                ResultSummary.Text        = ResultJson.ReportInfo.ToSummaryString();
                List <string> itemKeyList = ResultJson.ItemResults.Keys.ToList();
                itemKeyList.Sort();

                foreach (string itemName in itemKeyList)
                {
                    ItemResultJsonData item = ResultJson.ItemResults[itemName];
                    PassStatus passStatus   = PassStatus.FromString(item.PassStatus);
                    if (passStatus == PassStatus.PASS)
                    {
                        ResultRow newRow = new ResultRow()
                        {
                            Item = itemName, PassStatus = passStatus.ToString(), ErrorCount = "", ErrorType = ""
                        };
                        ResultGrid.Items.Add(newRow);
                    }
                    else if (passStatus == PassStatus.NOTPASS)
                    {
                        foreach (TaskResultJsonData taskResult in item.CheckResults)
                        {
                            if (!taskResult.Pass)
                            {
                                ResultRow newRow = new ResultRow()
                                {
                                    Item = itemName, PassStatus = passStatus.ToString(), ErrorCount = taskResult.errCateCount, ErrorType = taskResult.ErrorType
                                };
                                ResultGrid.Items.Add(newRow);
                            }
                        }
                    }
                }
            }));
        }