private static EventHandler <MonitorEventArgs> UnregisterEvent(EventHandler <MonitorEventArgs> original, EventHandler <MonitorEventArgs> oldDel) { original = original - oldDel; if (original == null) { registerCount--; if (registerCount == 0) { //unregister for those events. SensLogon.eventCatcher.Dispose(); SensLogon.eventCatcher = null; } } return(original); }
private static EventHandler <MonitorEventArgs> RegisterEvent(EventHandler <MonitorEventArgs> original, EventHandler <MonitorEventArgs> newDel) { bool shouldRegister = (original == null); original = original + newDel; if (shouldRegister) { if (registerCount <= 0) { if (SensLogon.eventCatcher == null) { SensLogon.eventCatcher = new SensLogonInterop(); } registerCount = 1; } else { //Just count them. registerCount++; } } return(original); }
private static EventHandler<MonitorEventArgs> UnregisterEvent(EventHandler<MonitorEventArgs> original, EventHandler<MonitorEventArgs> oldDel) { original = original - oldDel; if (original == null) { registerCount--; if (registerCount == 0) { //unregister for those events. SensLogon.eventCatcher.Dispose(); SensLogon.eventCatcher = null; } } return original; }
private static EventHandler<MonitorEventArgs> RegisterEvent(EventHandler<MonitorEventArgs> original, EventHandler<MonitorEventArgs> newDel) { bool shouldRegister = (original == null); original = original + newDel; if (shouldRegister) { if (registerCount <= 0) { if (SensLogon.eventCatcher == null) SensLogon.eventCatcher = new SensLogonInterop(); registerCount = 1; } else { //Just count them. registerCount++; } } return original; }