Beispiel #1
0
 public static Device Wait(Device[] devices, int millisecondsTimeout, bool exitContext)
 {
     ManualResetEvent[] waitHandles = new ManualResetEvent[devices.Length];
     for (int i = 0; i < devices.Length; i++)
     {
         waitHandles[i] = devices[i].unempty;
     }
     int index = WaitHandle.WaitAny(waitHandles, millisecondsTimeout, exitContext);
     if (index == 0x102)
     {
         return null;
     }
     return devices[index];
 }
Beispiel #2
0
 private static Mouse[] SelectMice(Device[] devices)
 {
     int num = 0;
     foreach (Device device in devices)
     {
         if (device is Mouse)
         {
             num++;
         }
     }
     Mouse[] mouseArray = new Mouse[num];
     num = 0;
     foreach (Device device2 in devices)
     {
         if (device2 is Mouse)
         {
             mouseArray[num++] = (Mouse)device2;
         }
     }
     return mouseArray;
 }
Beispiel #3
0
 public static new Mouse Wait(Device[] devices, TimeSpan timeout, bool exitContext)
 {
     return (Mouse)Device.Wait(SelectMice(devices), timeout, exitContext);
 }
Beispiel #4
0
 public static new Mouse Wait(Device[] devices, int millisecondsTimeout, bool exitContext)
 {
     return (Mouse)Device.Wait(SelectMice(devices), millisecondsTimeout, exitContext);
 }
Beispiel #5
0
 public static new Mouse Wait(Device[] devices)
 {
     return (Mouse)Device.Wait(SelectMice(devices));
 }
 private static Keyboard[] SelectKeyboards(Device[] devices)
 {
     int num = 0;
     foreach (Device device in devices)
     {
         if (device is Keyboard)
         {
             num++;
         }
     }
     Keyboard[] keyboardArray = new Keyboard[num];
     num = 0;
     foreach (Device device2 in devices)
     {
         if (device2 is Keyboard)
         {
             keyboardArray[num++] = (Keyboard) device2;
         }
     }
     return keyboardArray;
 }
 public static new Keyboard Wait(Device[] devices, TimeSpan timeout, bool exitContext)
 {
     return (Keyboard) Device.Wait(SelectKeyboards(devices), timeout, exitContext);
 }
 public static new Keyboard Wait(Device[] devices, int millisecondsTimeout, bool exitContext)
 {
     return (Keyboard) Device.Wait(SelectKeyboards(devices), millisecondsTimeout, exitContext);
 }
 public static new Keyboard Wait(Device[] devices)
 {
     return (Keyboard) Device.Wait(SelectKeyboards(devices));
 }
Beispiel #10
0
 public static Device Wait(Device[] devices, TimeSpan timeout)
 {
     return Wait(devices, timeout, false);
 }
Beispiel #11
0
 public static Device Wait(Device[] devices, int millisecondsTimeout)
 {
     return Wait(devices, millisecondsTimeout, false);
 }
Beispiel #12
0
 public static Device Wait(Device[] devices)
 {
     return Wait(devices, -1, false);
 }