public static string AddSensor(this ISensor sensor, IDictionary <string, object> msg) { var name = sensor.GetID(); // Add the object to the dictionary msg.Add(name, sensor.Value); return(name); }
public void OnSensorEnter(ISensor nativeSensor, NativeSensorState state) { if (state == NativeSensorState.Ready) { Guid sensorId; HResult hr = nativeSensor.GetID(out sensorId); if (hr == HResult.Ok) { SensorManager.OnSensorsChanged(sensorId, SensorAvailabilityChange.Addition); } } }