AcManager.Pages.Drive.QuickDrive.ViewModel.UpdateConditions C# (CSharp) Method

UpdateConditions() public method

public UpdateConditions ( ) : void
return void
            public async void UpdateConditions() {
                if (_saveable.IsLoading) return;
                _updateCancellationTokenSource?.Cancel();

                if (!RealConditions) {
                    IsTemperatureClamped = false;
                    IsWeatherNotSupported = false;
                    ManualTime = true;
                    RealWeather = null;

                    _weatherCandidatesFootprint = null;
                } else {
                    ManualTime = RealConditionsManualTime;

                    using (var cancellation = new CancellationTokenSource()) {
                        _updateCancellationTokenSource = cancellation;

                        try {
                            await Update(cancellation.Token);
                        } catch (TaskCanceledException) { } catch (Exception e) {
                            Logging.Warning("[QuickDrive.Conditions] Update(): " + e);
                        }

                        _updateCancellationTokenSource = null;
                    }
                }
            }