private void TcServices_OnTelemetryChanging(object sender, TelemetryControl.TelemetryEventArgs e) { var telemetry = (TelemetryService)e.Telemetry; if (e.Enabled) { var startupResult = NvidiaController.EnableTelemetryServiceStartup(telemetry); Logging.GetFileLogger().Log(Level.Info, startupResult.Error != null ? $"{Properties.Resources.Automatic_service_startup_failed}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})" : $"{Properties.Resources.Automatic_service_startup_enabled}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})"); var result = NvidiaController.EnableTelemetryService(telemetry); Logging.GetFileLogger().Log(Level.Info, result.Error != null ? $"{Properties.Resources.Failed_to_start_service}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})" : $"{Properties.Resources.Service_started}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})"); } else { var startupResult = NvidiaController.DisableTelemetryServiceStartup(telemetry); Logging.GetFileLogger().Log(Level.Info, startupResult.Error != null ? $"{Properties.Resources.Disable_service_startup_failed}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})" : $"{Properties.Resources.Automatic_service_startup_disabled}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})"); var result = NvidiaController.DisableTelemetryService(telemetry); Logging.GetFileLogger().Log(Level.Info, result.Error != null ? $"{Properties.Resources.Failed_to_stop_service}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})" : $"{Properties.Resources.Service_stopped}: {telemetry.Service.DisplayName} ({telemetry.Service.ServiceName})"); } }
private void tcServices_DefaultClicked(object sender, EventArgs e) { tcServices.Reset(); foreach (var item in _telemetryServices) { var result = NvidiaController.EnableTelemetryServiceStartup(item); Logging.GetFileLogger().Log(Level.Info, result.Error != null ? $"{Properties.Resources.Automatic_service_startup_failed}: {item.Service.DisplayName} ({item.Service.ServiceName})" : $"{Properties.Resources.Automatic_service_startup_enabled}: {item.Service.DisplayName} ({item.Service.ServiceName})"); } foreach (var item in _telemetryServices) { var result = NvidiaController.EnableTelemetryService(item); Logging.GetFileLogger().Log(Level.Info, result.Error != null ? $"{Properties.Resources.Failed_to_start_service}: {item.Service.DisplayName} ({item.Service.ServiceName})" : $"{Properties.Resources.Service_started}: {item.Service.DisplayName} ({item.Service.ServiceName})"); } RefreshTelemetryServices(false); }