Ejemplo n.º 1
0
 //<SnippetDisposeLamp>
 protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
 {
     lamp.AvailabilityChanged -= Lamp_AvailabilityChanged;
     lamp.IsEnabled            = false;
     lamp.Dispose();
     lamp = null;
 }
        /// <summary>
        /// Turns of the flashlight if it is on
        /// </summary>
        public static void DisableFlashlight()
        {
#if (NETFX_CORE && UNITY_WSA_10_0) || (ENABLE_IL2CPP && UNITY_WSA_10_0)
            if (_lamp != null)
            {
                _lamp.IsEnabled = false;
                _lamp.Dispose();
                _lamp = null;
            }
#endif
        }
Ejemplo n.º 3
0
        static Task PlatformTurnOffAsync()
        {
            lock (locker)
            {
                if (lamp != null)
                {
                    lamp.IsEnabled = false;
                    lamp.Dispose();
                    lamp          = null;
                    hasLoadedLamp = false;
                }
            }

            return(Task.CompletedTask);
        }