Exemple #1
0
        /// <summary>
        ///   Prepare a connection to an IRC server but do not open it. This sets the text Encoding to Default.
        /// </summary>
        /// <param name = "args">The set of information need to connect to an IRC server</param>
        /// <param name = "enableCtcp">True if this Connection should support CTCP.</param>
        /// <param name = "enableDcc">True if this Connection should support DCC.</param>
        public Connection(ConnectionArgs args, bool enableCtcp, bool enableDcc)
        {
            _propertiesRegex = new Regex("([A-Z]+)=([^\\s]+)", RegexOptions.Compiled | RegexOptions.Singleline);
            _registered = false;
            _connected = false;
            _handleNickFailure = true;
            ConnectionArgs = args;
            _parsers = new ArrayList();
            _sender = new Sender(this);
            _listener = new Listener();

            RegisterDelegates();
            _timeLastSent = DateTime.Now;
            EnableCtcp = enableCtcp;
            EnableDcc = enableDcc;
            TextEncoding = Encoding.Default;
        }
Exemple #2
0
 /// <summary>
 ///   Used for internal test purposes only.
 /// </summary>
 internal Connection(ConnectionArgs args)
 {
     ConnectionArgs = args;
     _sender = new Sender(this);
     _listener = new Listener();
     _timeLastSent = DateTime.Now;
     EnableCtcp = true;
     EnableDcc = true;
     TextEncoding = Encoding.Default;
 }