/// <summary> /// Directly open a device /// </summary> /// <param name="name"></param> /// <returns></returns> public IOpenedDevice OpenDevice(string name) { IntPtr handle; var status = NativeMethods.SaneOpen(name, out handle); if (status != (int)SaneStatus.Success) throw NSaneException.CreateFromStatus((int)status); var device = new LocalDevice(name, handle); return device; }
/// <summary> /// Directly open a device /// </summary> /// <param name="name"></param> /// <returns></returns> public IOpenedDevice OpenDevice(string name) { IntPtr handle; var status = NativeMethods.SaneOpen(name, out handle); if (status != (int)SaneStatus.Success) { throw NSaneException.CreateFromStatus((int)status); } var device = new LocalDevice(name, handle); return(device); }