private void btnParseSwitch_Click(object sender, EventArgs e) { profilerLog = null; selectedTestCase = null; ddlistTestCases.DropDownItems.Clear(); lstResultList.Items.Clear(); updateStatusLabel("Start to parse log date, please wait...... ", Color.Black); btnParseSwitch.Text = " Stop parse"; btnParseSwitch.Image = global::com.usi.shd1_tools.TestGuide.Properties.Resources.stop; cmbLogFileList.Enabled = false; ddlistTestCases.Visible = false; this.Cursor = Cursors.WaitCursor; Application.DoEvents(); parseLog_Flag = !parseLog_Flag; startLogParse(cmbLogFileList.Text); profilerLog.RefreshIsMsgTimeout(FormToolSettings.MaxLogInterval); showSummaries(); currentTCIndex = -1; currentPageIndex = -1; currentLine = -1; btnNext.Visible = true; btnPrevious.Visible = true; this.Cursor = Cursors.Default; ddlistTestCases.Visible = ddlistTestCases.DropDownItems.Count > 0; btnParseSwitch.Text = " Start parse"; btnParseSwitch.Image = global::com.usi.shd1_tools.TestGuide.Properties.Resources.Start; cmbLogFileList.Enabled = true; updateStatusLabel("All messages = " + profilerLog.MessageCount + " ; Fail = " + profilerLog.ErrorCount, Color.Black); #region auto-select the first testcase result to show as default if (ddlistTestCases.DropDownItems.Count > 0) { ddlistTestCases_DropDownItemClicked(ddlistTestCases, new ToolStripItemClickedEventArgs(ddlistTestCases.DropDownItems[0])); } #endregion auto-select the first testcase result to show as default }
private void startLogParse(String logPath) { profilerLog = new ProfilerLog(logPath); profilerLog.Parse(); foreach (ProfilerLog_TestCase tc in profilerLog.TestCaseList) { ddlistTestCases.DropDownItems.Add(tc.Title + "( " + tc.StartTime.ToString("HH:mm:ss") + "~" + tc.EndTime.ToString("HH:mm:ss") + " )"); } }