public bool start() { try { var controller = new EngineServiceController("EasyTuneEngineService"); if (controller.IsInstall() == false) { controller.Dispose(); this.stop(); return(false); } if (controller.Status != System.ServiceProcess.ServiceControllerStatus.Running) { controller.Start(); } controller.Dispose(); } catch { } this.lockBus(); try { mGigabyteHardwareMonitorControlModule = new HardwareMonitorControlModule(); mGigabyteHardwareMonitorControlModule.Initialize(HardwareMonitorSourceTypes.HwRegister); mGigabyteSmartGuardianFanControlModule = new SmartGuardianFanControlModule(); var temperatureList = new List <float>(); mGigabyteSmartGuardianFanControlModule.GetHardwareMonitorDatas(ref temperatureList, ref mGigabyteFanSpeedList); if (OptionManager.getInstance().IsGigabyteGpu == true) { var management = new GraphicsCardServiceManagement(); if (management.IsProcessExist() == true) { mGigabyteGraphicsCardControlModule = new GraphicsCardControlModule(); if (mGigabyteGraphicsCardControlModule.AmdGpuCount > 0) { mGigabyteGraphicsCardControlModule.GetObjects(ref mGigabyteAmdRadeonGraphicsModuleList); } if (mGigabyteGraphicsCardControlModule.NvidiaGpuCount > 0) { mGigabyteGraphicsCardControlModule.GetObjects(ref mGigabyteNvidiaGeforceGraphicsModuleList); } } } this.unlockBus(); return(true); } catch { this.unlockBus(); this.stop(); } return(false); }
public static void stopService() { try { var controller = new EngineServiceController("EasyTuneEngineService"); if (controller.IsInstall() == false) { return; } if (controller.Status != System.ServiceProcess.ServiceControllerStatus.Stopped) { controller.Stop(); } controller.Dispose(); } catch { } }