/// <summary> /// Construct the device with the bits and bobs it needs /// </summary> /// <param name="name">The name of the device (unique I think)</param> /// <param name="vendor">The vendor</param> /// <param name="model">The model</param> /// <param name="type">The type</param> /// <param name="caller">The network RPC calling implementation</param> /// <param name="userName">The username to use for authenticated calls /// </param> /// <param name="password">The password to use for authenticated calls /// </param> internal NetworkDevice(string name, string vendor, string model, string type, NetworkProcedureCaller caller, string userName, string password) : base(name, vendor, model, type) { _caller = caller; _userName = userName; _password = password; }
/// <summary> /// Construct a network device in the open state /// </summary> /// <param name="name">The name</param> /// <param name="handle">The handle</param> /// <param name="caller">The network RPC calling implementation</param> /// <param name="userName">The username to use for authenticated calls /// </param> /// <param name="password">The password to use for authenticated calls /// </param> internal NetworkDevice(string name, int handle, NetworkProcedureCaller caller, string userName, string password) : base(name, null, null, null) { _caller = caller; _userName = userName; _password = password; _handle = handle; _open = true; }
/// <summary> /// Construct with the host and port of the SANE daemon /// </summary> /// <param name="host">The host to connect to</param> /// <param name="port">The port to connect on</param> /// <param name="versionCode">The SANE version code</param> /// <param name="userName">The user name</param> /// <param name="password">The password</param> internal NetworkConnection(string host, int port, int versionCode, string userName, string password) { _userName = userName; _password = password; _caller = new NetworkProcedureCaller(host, port); Version = _caller.Initialise(_userName, versionCode); _open = true; }