Inheritance: ILightSensorReading
コード例 #1
0
ファイル: LightSensor.wasm.cs プロジェクト: Robert-Louis/Uno
        public static int DispatchReading(float lux)
        {
            var reading = new LightSensorReading(lux, DateTimeOffset.UtcNow);

            OnReadingChanged(reading);

            return(0);
        }
コード例 #2
0
ファイル: MainPage.xaml.cs プロジェクト: Agies/Whimsy
        public MainPage()
        {
            InitializeComponent();
            _locator = new Geolocator();
            Loaded += OnControlLoaded;

            _lightSensor = LightSensor.GetDefault();
            if (_lightSensor != null)
            {
                //For now we get a base reading to use to compare later
                _baseReading = _lightSensor.GetCurrentReading();
                //Register for the reading change
                _lightSensor.ReadingChanged += OnLightReadingChanged;
            }

            _accelerometerSensor = Accelerometer.GetDefault();
            if (_accelerometerSensor != null)
            {
                _accelerometerSensor.Shaken += OnShaken;
            }
            _compassSensor = Compass.GetDefault();
            if (_compassSensor != null)
            {
                _compassSensor.ReadingChanged += OnCompassReadingChanged;
            }
            _gyroSensor = Gyrometer.GetDefault();
            if (_gyroSensor != null)
            {
                _gyroSensor.ReadingChanged += OnGyroReadingChanged;
            }
            _inclineSensor = Inclinometer.GetDefault();
            if (_inclineSensor != null)
            {
                _inclineSensor.ReadingChanged += OnInclineReadingChanged;
            }
            _orientationSensor = OrientationSensor.GetDefault();
            if (_orientationSensor != null)
            {
                _orientationSensor.ReadingChanged += OnOrientationReadingChanged;
            }
        }
コード例 #3
0
ファイル: LogRecord.cs プロジェクト: swnhieian/Keyboard
 public void setLightSensorReading(LightSensorReading reading)
 {
     this.lightIntensity = reading.IlluminanceInLux;
 }