public Line(Line line) { Client = line.Client; RawString = line.RawString; RawStringParts = line.RawStringParts; Prefix = line.Prefix; Command = line.Command; Target = line.Target; Message = line.Message; }
public Line(IrcClient client, string line) { RawString = line; RawStringParts = line.Split(' '); Client = client; if (line[0] == ':') { line = line.Substring(1); var prefixDelim = line.Split(new[] { ' ' }, 2); Prefix = new User(prefixDelim[0]); if (prefixDelim.Length > 1) { var messageDelim = prefixDelim[1].Split(new[] { ':' }, 2); var args = messageDelim[0].Trim().Split(' '); Command = args[0]; if (args.Length > 1) Target = args[1]; if (messageDelim.Length > 1) Message = messageDelim[1]; } } else { var messageDelim = line.Split(new[] { ':' }, 2); var args = messageDelim[0].Trim().Split(' '); Command = args[0]; if (args.Length > 1) Target = args[1]; if (messageDelim.Length > 1) Message = messageDelim[1]; } }
public IrcClientUser(IrcClient client) { Client = client; }