IrcDotNet.IrcClient.HandleISupportParameter C# (CSharp) Method

HandleISupportParameter() protected method

Handles the specified parameter value of an ISUPPORT message, received from the server upon registration.
protected HandleISupportParameter ( string paramName, string paramValue ) : bool
paramName string The name of the parameter.
paramValue string /// The value of the parameter, or if it does not have a value. ///
return bool
        protected bool HandleISupportParameter(string paramName, string paramValue)
        {
            if (paramName == null)
                throw new ArgumentNullException("paramName");
            if (paramName.Length == 0)
                throw new ArgumentException(Resources.MessageValueCannotBeEmptyString, "paramName");

            // Check name of parameter.
            switch (paramName.ToLowerInvariant())
            {
                case "prefix":
                    var prefixValueMatch = Regex.Match(paramValue, isupportPrefix);
                    ;
                    var prefixes = prefixValueMatch.Groups["prefixes"].GetValue();
                    var modes = prefixValueMatch.Groups["modes"].GetValue();

                    if (prefixes.Length != modes.Length)
                        throw new ProtocolViolationException(Resources.MessageISupportPrefixInvalid);

                    lock (((ICollection) ChannelUserModes).SyncRoot)
                    {
                        channelUserModes.Clear();
                        channelUserModes.AddRange(modes);
                    }

                    channelUserModesPrefixes.Clear();
                    for (var i = 0; i < prefixes.Length; i++)
                        channelUserModesPrefixes.Add(prefixes[i], modes[i]);

                    return true;
                default:
                    return false;
            }
        }
IrcClient