protected override void OnStart(string[] args) { eventLog1.WriteEntry("Start UDD Service", EventLogEntryType.Information); DeviceChangeNotifier.Start(); DeviceChangeNotifier.DeviceNotify += DeviceChangeNotifier_DeviceNotify; DeviceChangeNotifier.DeviceNotifyVolume += DeviceChangeNotifier_DeviceNotifyVolume; }
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(); }
public static void Stop() { foreach (var item in hidDevList) { item.Dispose(); } hidDevList.Clear(); DeviceChangeNotifier.Stop(); }
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); }
protected override void OnContinue() { eventLog1.WriteEntry("Continue UDD Service", EventLogEntryType.Information); DeviceChangeNotifier.Stop(); DeviceChangeNotifier.Start(); }
static void Main(string[] args) { DeviceChangeNotifier.Start(); Console.ReadLine(); }
// Subclasses the parent window public MessageSnooper(DeviceChangeNotifier owner, IntPtr handle) { this.owner = owner; this.AssignHandle(handle); }