public static IEnumerable <EventBase> ReadEvents(this StreamReader sr) { string line; while (!string.IsNullOrEmpty(line = sr.ReadLine())) { if (!line.StartsWith("//")) { yield return(EventBase.FromString(line)); } } }