GetInfo() private method

private GetInfo ( int handle ) : bool
handle int
return bool
Ejemplo n.º 1
0
 protected override bool TryCreateDevice(object key, out HidDevice device, out object creationState)
 {
     creationState = null;
     var path = (NativeMethods.io_string_t)key; var hidDevice = new MacHidDevice(path);
     using (var handle = NativeMethods.IORegistryEntryFromPath(0, ref path).ToIOObject())
     {
         if (!handle.IsSet || !hidDevice.GetInfo(handle)) { device = null; return false; }
         device = hidDevice; return true;
     }
 }
Ejemplo n.º 2
0
        protected override bool TryCreateDevice(object key, out HidDevice device, out object creationState)
        {
            creationState = null;
            var path = (NativeMethods.io_string_t)key; var hidDevice = new MacHidDevice(path);

            using (var handle = NativeMethods.IORegistryEntryFromPath(0, ref path).ToIOObject())
            {
                if (!handle.IsSet || !hidDevice.GetInfo(handle))
                {
                    device = null; return(false);
                }
                device = hidDevice; return(true);
            }
        }