예제 #1
0
    //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();
    }
예제 #2
0
        private void FetchValues()
        {
            foreach (var openPin in _openPins)
            {
                FetchValues(openPin);
            }

            ValuesUpdated?.Invoke(this, EventArgs.Empty);
        }
예제 #3
0
        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);
        }
예제 #4
0
 private void OnValuesUpdated(AccelerometerData data)
 {
     ValuesUpdated?.Invoke(this, new AccelerometerEventArgs(data));
 }