Example #1
0
        /// <summary>
        /// Uses custom connection information to authenticate and communicate with the server and defines tag.
        /// </summary>
        /// <param name="server">Server information to use.</param>
        /// <param name="user">User connection information to use.</param>
        /// <param name="tag">User defined data associated with the ClientActions class.</param>
        public ServerConnector(ServerConnectorServerInformation server, ServerConnectorUserInformation user, object tag)
        {
            if (Client.config == null)            // NullReferenceException with designer...  This is to prevent errors/crashes.
            {
                return;
            }

            this.actions     = new ClientActions(this, tag);
            this.server_info = server;
            this.user_info   = user;
            this.tag         = tag;

            Client.config.addValueChangedEvent("connector.max_download_kbps", config_changed_max_download_kbps);
            Client.config.addValueChangedEvent("connector.max_upload_kbps", config_changed_max_upload_kbps);
            Client.config.addValueChangedEvent("connector.max_download_enabled", config_changed_max_download_enabled);
            Client.config.addValueChangedEvent("connector.max_upload_enabled", config_changed_max_upload_enabled);

            // Go ahead and fix the upload values.
            config_changed_max_upload_kbps();
            config_changed_max_download_kbps();
        }
        /// <summary>
        /// Uses custom connection information to authenticate and communicate with the server and defines tag.
        /// </summary>
        /// <param name="server">Server information to use.</param>
        /// <param name="user">User connection information to use.</param>
        /// <param name="tag">User defined data associated with the ClientActions class.</param>
        public ServerConnector(ServerConnectorServerInformation server, ServerConnectorUserInformation user, object tag)
        {
            if(Client.config == null) // NullReferenceException with designer...  This is to prevent errors/crashes.
                return;

            this.actions = new ClientActions(this, tag);
            this.server_info = server;
            this.user_info = user;
            this.tag = tag;

            Client.config.addValueChangedEvent("connector.max_download_kbps", config_changed_max_download_kbps);
            Client.config.addValueChangedEvent("connector.max_upload_kbps", config_changed_max_upload_kbps);
            Client.config.addValueChangedEvent("connector.max_download_enabled", config_changed_max_download_enabled);
            Client.config.addValueChangedEvent("connector.max_upload_enabled", config_changed_max_upload_enabled);

            // Go ahead and fix the upload values.
            config_changed_max_upload_kbps();
            config_changed_max_download_kbps();
        }
 /// <summary>
 /// Uses custom connection information to authenticate and communicate with the server.
 /// </summary>
 /// <param name="server">Server information to use.</param>
 /// <param name="user">User connection information to use.</param>
 public ServerConnector(ServerConnectorServerInformation server, ServerConnectorUserInformation user)
     : this(server, user, null)
 {
 }
Example #4
0
 /// <summary>
 /// Uses custom connection information to authenticate and communicate with the server.
 /// </summary>
 /// <param name="server">Server information to use.</param>
 /// <param name="user">User connection information to use.</param>
 public ServerConnector(ServerConnectorServerInformation server, ServerConnectorUserInformation user) : this(server, user, null)
 {
 }