//static RemoteSettingsValues() //{ // BackgroundSpeed = RemoteSettings.GetFloat("background-speed", 0.5f); // RemoteSettings.Completed += HandleRemoteSettingsCompleted; //} private static void HandleRemoteSettingsCompleted(bool wasUpdatedFromServer, bool settingsChanged, int serverResponse) { backgroundSpeed = RemoteSettings.GetFloat("background-speed", 0.5f); maxShields = RemoteSettings.GetInt("max-shields", 3); shieldProbability = RemoteSettings.GetFloat("shield-probability", 0.1f); ValuesUpdated?.Invoke(); }
private void FetchValues() { foreach (var openPin in _openPins) { FetchValues(openPin); } ValuesUpdated?.Invoke(this, EventArgs.Empty); }
private void FetchValues() { lock (_dht22States) { foreach (var sensor in _dht22States) { float temperature; float humidity; if (TryFetchValues(sensor.Key, out temperature, out humidity)) { sensor.Value.Temperature = temperature; sensor.Value.Humidity = humidity; } } } ValuesUpdated?.Invoke(this, EventArgs.Empty); }
private void OnValuesUpdated(AccelerometerData data) { ValuesUpdated?.Invoke(this, new AccelerometerEventArgs(data)); }