Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 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;
 }