IrcShark.Chatting.Irc.IrcLine.IrcLine C# (CSharp) Method

IrcLine() public method

Initializes a new instance of the IrcLine class from the the given raw string.
If the format of the raw string can't be parsed as an irc line, an InvalidLineFormatException is thrown.
public IrcLine ( IrcClient client, string line ) : System
client IrcClient /// The , this line was received by. ///
line string /// The raw line as a . ///
return System
        public IrcLine(IrcClient client, string line)
        {
            this.client = client;
            string[] normalParams;
            Match m = ircLineRegEx.Match(line);
            if (m.Success)
            {
                if (m.Groups[1].Success)
                {
                    prefix = m.Groups[1].Value;
                }

                command = m.Groups[2].Value;
                if (!Int32.TryParse(command, out numeric))
                {
                    numeric = 0;
                }

                normalParams = m.Groups[3].Value.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                if (m.Groups[4].Success)
                {
                    parameters = new string[normalParams.Length + 1];
                    normalParams.CopyTo(parameters, 0);
                    parameters[parameters.Length - 1] = m.Groups[4].Value;
                }
                else if (normalParams.Length != 0)
                {
                    parameters = normalParams;
                }
            }
            else
            {
                throw new InvalidLineFormatException(line);
            }
        }

Same methods

IrcLine::IrcLine ( IrcClient client, string prefix, string command, string parameters ) : System
IrcLine::IrcLine ( IrcLine source ) : System