| 173 | } |
| 174 | |
| 175 | private void toolStripButton_launch_Click(object sender, EventArgs e) |
| 176 | { |
| 177 | toolStripButton_selectApp.Enabled = false; |
| 178 | toolStripTextBox_path.Enabled = false; |
| 179 | toolStripButton_launch.Enabled = false; |
| 180 | |
| 181 | listView_log.Items.Clear(); |
| 182 | textBox_log.Text = String.Empty; |
| 183 | clearListView(); |
| 184 | _PerformanceDataRecorder.Clear(); |
| 185 | |
| 186 | try |
| 187 | { |
| 188 | _Target.Start(toolStripTextBox_path.Text, Path.GetDirectoryName(toolStripTextBox_path.Text)); |
| 189 | toolStripStatusLabel_status.Text = String.Format("运行中 - {0}", _Target.Lifetime.ToString("g")); |
| 190 | } |
| 191 | catch (Exception ex) |
| 192 | { |
| 193 | MessageBox.Show("无法启动性能监测。\n\n错误:" + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); |
| 194 | |
| 195 | toolStripButton_selectApp.Enabled = true; |
| 196 | toolStripTextBox_path.Enabled = true; |
| 197 | toolStripButton_launch.Enabled = true; |
| 198 | return; |
| 199 | } |
| 200 | |
| 201 | performanceChart_main.Reset(); |
| 202 | |
| 203 | // 启动计时器 |
| 204 | timer_main.Enabled = true; |
| 205 | } |
| 206 | |
| 207 | void Target_OnResourceCleared(TargetProgram.ResourcePoolType pool) |
| 208 | { |