public static List<Bulletin> inCP(Session Session, ICourseProjectCommons Parent) { string path = Parent.getDashboardPath(); HtmlDocument Document = Session.GetDocument(path); var nodesWithHrefToBulletin = from node in Document.DocumentNode.DescendantNodes() where node.Name == "a" && node.GetAttributeValue("href", "").Contains("/Bulletin/View") select node.GetAttributeValue("href", ""); List<Bulletin> Bulletins = new List<Bulletin>(nodesWithHrefToBulletin.Count()); int i = 0; foreach (string uri_string in nodesWithHrefToBulletin) { Uri uri = uri_string.StartsWith("/") ? new Uri(Properties.Settings.Default.urlBase + uri_string) : new Uri(uri_string); Bulletins[i++] = new Bulletin(Session, Parent, uint.Parse(HttpUtility.ParseQueryString(uri.Query).Get("BulletinId"))); } return Bulletins; }
public Bulletin(Session Session, ICourseProjectCommons Parent, uint Id) { this.Id = Id; this.Session = Session; this.Parent = Parent; }
public Directory(Session Session, ICourseProjectCommons Parent, uint Id) { this.Session = Session; this.Parent = Parent; this._Id = Id; }