Example #1
0
 /// <summary>
 /// Construct the option with what it needs
 /// </summary>
 /// <param name="name">The name of the option</param>
 /// <param name="title">The title of the option</param>
 /// <param name="description">A long description for the option</param>
 /// <param name="size">The size of the option</param>
 /// <param name="number">The number (i.e. index) of the option</param>
 /// <param name="type">The type of the option (string, bool, etc)
 /// </param>
 /// <param name="unit">The unit for the option (mm, etc, etc)</param>
 /// <param name="capabilities">A bit flag of the capabilities of
 /// the option</param>
 /// <param name="handle">The handle to the device</param>
 /// <param name="caller">The RPC caller</param>
 /// <param name="userName">The username for authenticated calls</param>
 /// <param name="password">The password for authenticated calls</param>
 /// <param name="reloadFunction">A function to call if setting this
 /// option requires that all the options are reloaded</param>
 internal NetworkDeviceOption(string name,
                              string title,
                              string description,
                              int size,
                              int number,
                              SaneType type,
                              SaneUnit unit,
                              SaneCapabilities capabilities,
                              int handle,
                              NetworkProcedureCaller caller,
                              string userName,
                              string password,
                              Action reloadFunction)
     : base(name,
            title,
            description,
            size,
            number,
            type,
            unit,
            capabilities,
            reloadFunction)
 {
     _handle   = handle;
     _userName = userName;
     _password = password;
     _caller   = caller;
 }
Example #2
0
 /// <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;
 }
Example #3
0
 /// <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;
 }
Example #4
0
        /// <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;
        }