Пример #1
0
 private void PollTimer_Elapsed(object state)
 {
     lock (PollTimerLock)
     {
         mDeviceListPollTimer.Change(-1, -1);
         MonoUsbDevice.RefreshProfileList();
         mDeviceListPollTimer.Change(PollingInterval, PollingInterval);
     }
 }
 private void PollTimer_Elapsed(object sender, ElapsedEventArgs e)
 {
     lock (PollTimerLock)
     {
         mDeviceListPollTimer.Stop();
         MonoUsbDevice.RefreshProfileList();
         mDeviceListPollTimer.Start();
     }
 }
Пример #3
0
        private void StartDeviceListPolling()
        {
            lock (PollTimerLock)
            {
                if (mDeviceListPollTimer != null)
                {
                    return;
                }

                MonoUsbDevice.RefreshProfileList();

                MonoUsbDevice.ProfileList.AddRemoveEvent += OnAddRemoveEvent;
                mDeviceListPollTimer = new Timer(PollTimer_Elapsed, null, PollingInterval, PollingInterval);
            }
        }