public void ReadTerms() { XmlDocument doc = TermsDoc; foreach (XmlNode node in doc.SelectNodes("/Terms/Term")) { XmlNode halfTerm = node.SelectSingleNode("HalfTerm"); string[] s = halfTerm.Attributes["startDate"].Value.Split(new char[] { '/' }); string[] s2 = halfTerm.Attributes["endDate"].Value.Split(new char[] { '/' }); HalfTerm ht = new HalfTerm(new DateTime(int.Parse(s[2]), int.Parse(s[1]), int.Parse(s[0])), new DateTime(int.Parse(s2[2]), int.Parse(s2[1]), int.Parse(s2[0]))); s = node.Attributes["startDate"].Value.Split(new char[] { '/' }); s2 = node.Attributes["endDate"].Value.Split(new char[] { '/' }); Add(new Term(node.Attributes["name"].Value, new DateTime(int.Parse(s[2]), int.Parse(s[1]), int.Parse(s[0])), new DateTime(int.Parse(s2[2]), int.Parse(s2[1]), int.Parse(s2[0])), int.Parse(node.Attributes["startWeekNum"].Value), ht)); } }
public Term(string name, DateTime startDate, DateTime endDate, int startWeekNum, HalfTerm halfTerm) { this.name = name; this.startDate = startDate; this.endDate = endDate; this.startWeekNum = startWeekNum; this.halfTerm = halfTerm; }