void totalCpuUsageMonitor_ErrorOccurredHandler(object sender, ErrorEventArgs e) { if (totalCpuUsageMonitor != null) { totalCpuUsageMonitor.Dispose(); totalCpuUsageMonitor = null; var totalCpuUsageSeries = chartTotalCpuUsage.Series["TotalCpuUsageSeries"]; totalCpuUsageSeries.Points.Clear(); } MessageBox.Show(e.Error.Message); }
void processCpuUsageMonitor_ErrorOccurredHandler(object sender, ErrorEventArgs e) { if (processCpuUsageMonitor != null) { processCpuUsageMonitor.Dispose(); processCpuUsageMonitor = null; var processCpuUsageSeries = chartProcessCupUsage.Series["ProcessCpuUsageSeries"]; processCpuUsageSeries.Points.Clear(); } MessageBox.Show(e.Error.Message); }
/// <summary> /// 激发 totalCpuUsageMonitor_ErrorOccurredHandler以处理totalCpuUsageMonitor的 /// ErrorOccurred事件. /// </summary> void totalCpuUsageMonitor_ErrorOccurred(object sender, ErrorEventArgs e) { this.Invoke(new EventHandler<ErrorEventArgs>( totalCpuUsageMonitor_ErrorOccurredHandler), sender, e); }
/// <summary> /// 引发ErrorOccurred事件. /// </summary> protected virtual void OnErrorOccurred(ErrorEventArgs e) { if (this.ErrorOccurred != null) { this.ErrorOccurred(this, e); } }