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);
}
}