public static List <TextPart> GetAllParts(this TextParser parser) { var textParts = new List <TextPart>(); while (parser.AnyParts()) { textParts.Add(parser.GetNextPart()); } return(textParts); }