public static List<Beamer> GetBeamerEntries(string html) { List<Beamer> beamers = new List<Beamer>(); List<string> l = new List<string>(); l = html.Split(new string[] {"<tr>"},StringSplitOptions.RemoveEmptyEntries).ToList(); for (int i = 0; i < l.Count; i++) { List<string> Line = new List<string>(); int index = 0; l[i] = l[i].Trim(); while (true) { string beginn = l[i].Substring(l[i].IndexOf("\">") + ("\">").Count()); if (beginn.Substring(1).Contains("<td")) { l[i] = beginn.Substring(beginn.Substring(1).IndexOf("<td")); beginn = beginn.Substring(0, beginn.IndexOf("<td")); Line.Add(beginn.Trim()); } else { Line.Add(beginn.Trim()); break; } } string time; if (Line[1] != " " && Line[1].Count() > 2) { time = "Von " + Line[0] + " bis " +Line[1]; } else { time = Line[0] + " " + Line[2] + " - " + Line[3]; } Beamer b = new Beamer { time = time, content = Line[5], title = Line[4], important = false }; beamers.Add(b); } return beamers; }
public BeamerSaveObject(Beamer b) { this.title = b.title; this.content = b.content; this.important = b.important; this.time = b.time; }