public void ParseOutput(string output) { List <MessageText> messages = new List <MessageText>(); var split = output.Split(new char[] { '\n', '\r' }).Where(s => s.Length > 0); MessageText message = null; foreach (var line in split) { if (message == null) { message = GetMessage(line); continue; } if (!message.Accept(line)) { if (!message.Note) // todo handle notes { messages.Add(message); } message = GetMessage(line); } } if (message != null && !message.Note) { messages.Add(message); } Failures.AddRange(messages); OutputComplete(); }