Esempio n. 1
0
 protected override void OnStart(string[] args)
 {
     eventLog1.WriteEntry("Start UDD Service", EventLogEntryType.Information);
     DeviceChangeNotifier.Start();
     DeviceChangeNotifier.DeviceNotify       += DeviceChangeNotifier_DeviceNotify;
     DeviceChangeNotifier.DeviceNotifyVolume += DeviceChangeNotifier_DeviceNotifyVolume;
 }
Esempio n. 2
0
 private static void StartSign(string message, IWebSocketConnection socket)
 {
     try
     {
         if (!DeviceChangeNotifier.isStart())
         {
             DeviceChangeNotifier.Start();
         }
         else
         {
             DeviceChangeNotifier.Init();
         }
         DeviceChangeNotifier.OKResultFunc = ((a) =>
         {
             SocketReponse socketReponse = new SocketReponse();
             socketReponse.Data = a;
             DeviceChangeNotifier.Finalize();
             socket.Send(socketReponse.ToString());
         });
     }
     catch (Exception ex)
     {
         throw;
     }
 }
        public void Init()
        {
            //var eventMonitor = new Action(DeviceEventMonitor);
            //eventMonitor.BeginInvoke(DisposeDeviceEventMonitor, eventMonitor);
            DeviceChangeNotifier.DeviceNotify += DeviceEventMonitor;

            DeviceChangeNotifier.Start();
        }
Esempio n. 4
0
 public static void Stop()
 {
     foreach (var item in hidDevList)
     {
         item.Dispose();
     }
     hidDevList.Clear();
     DeviceChangeNotifier.Stop();
 }
Esempio n. 5
0
 public static void Start(int vendorId, int productId)
 {
     VendorId  = vendorId;
     ProductId = productId;
     DeviceChangeNotifier.DeviceAttached -= DeviceChangeNotifierDeviceAttached;
     DeviceChangeNotifier.DeviceAttached += DeviceChangeNotifierDeviceAttached;
     DeviceChangeNotifier.DeviceDetached -= DeviceChangeNotifierDeviceDetached;
     DeviceChangeNotifier.DeviceDetached += DeviceChangeNotifierDeviceDetached;
     DeviceChangeNotifier.Start(productId, vendorId);
 }
 protected override void SetVisibleCore(bool value)
 {
     // Prevent window getting visible
     if (mInstance == null)
     {
         CreateHandle();
     }
     mInstance = this;
     value     = false;
     base.SetVisibleCore(value);
 }
Esempio n. 7
0
 protected override void OnContinue()
 {
     eventLog1.WriteEntry("Continue UDD Service", EventLogEntryType.Information);
     DeviceChangeNotifier.Stop();
     DeviceChangeNotifier.Start();
 }
Esempio n. 8
0
        static void Main(string[] args)
        {
            DeviceChangeNotifier.Start();

            Console.ReadLine();
        }
Esempio n. 9
0
 // Subclasses the parent window
 public MessageSnooper(DeviceChangeNotifier owner, IntPtr handle)
 {
     this.owner = owner;
     this.AssignHandle(handle);
 }