示例#1
0
        /// <summary>
        /// Default class constructor.
        /// </summary>
        public Usb()
        {
            _service = DependencyService.Get <IUsb>();

            _service.UsbDebuggingChanged += (s, e) => { UsbDebuggingChanged?.Invoke(s, e); };

            _service.StartListening();
        }
 /// <summary>
 /// Starts observing USB information for changes.
 /// </summary>
 /// <remarks>
 /// UsbDebuggingChanged event will be never invoked before calling this method.
 /// </remarks>
 public void StartListening()
 {
     SystemSettings.UsbDebuggingSettingChanged +=
         (s, e) => { UsbDebuggingChanged?.Invoke(s, new UsbDebuggingEventArgs(e.Value)); };
 }