public Form_CpuTempMonitorSettings(CpuTemp temp, IWinhuePluginHost host) { InitializeComponent(); Temp = temp; Host = host; temp.OnTempUpdated += temp_OnTempUpdated; Temp.Start(); if (Dispatcher.CheckAccess()) { cbListCpuSensors.Items.Clear(); foreach (ISensor sensor in temp.cpuSensors) { cbListCpuSensors.Items.Add(sensor); if (sensor.Name.Contains("Package")) { cbListCpuSensors.SelectedIndex = cbListCpuSensors.Items.Count - 1; } } } else { Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() => { cbListCpuSensors.Items.Clear(); foreach (ISensor sensor in temp.cpuSensors) { cbListCpuSensors.Items.Add(sensor); if (sensor.Name.Contains("Package")) { cbListCpuSensors.SelectedIndex = cbListCpuSensors.Items.Count - 1; } } })); } }
/// <summary> /// Do the plugin work. /// </summary> public void Start() { _temp.Start(); }