Ejemplo n.º 1
0
 private void DisableDisplayOnOffController()
 {
     if (_displayController != null)
     {
         _displayController.Dispose(); // closes the controller
         _displayController = null;
     }
 }
Ejemplo n.º 2
0
 private void EnableDisplayOnOffController()
 {
     if (_sensor != null && _displayController == null)
     {
         // Acquires the display on/off controller for this proximity sensor.
         // This tells the system to use the sensor's IsDetected state to
         // turn the screen on or off.  If the display does not support this
         // feature, this code will do nothing.
         _displayController = _sensor.CreateDisplayOnOffController();
     }
 }