public Topic(UserTopicResultSetUserTopicsUserTopic data, Forum forum) { _data = data; _forum = forum; _messageID = 0; }
/// <summary> /// Initialise the forums element from the server. /// </summary> private void Initialise() { WebRequest wrGeturl = WebRequest.Create(CIXOAuth.GetUri("cix.svc/user/forums.xml")); wrGeturl.Method = "GET"; try { Stream objStream = wrGeturl.GetResponse().GetResponseStream(); if (objStream != null) { using (XmlReader reader = XmlReader.Create(objStream)) { XmlSerializer serializer = new XmlSerializer(typeof(ForumResultSet)); ForumResultSet listOfForums = (ForumResultSet)serializer.Deserialize(reader); _forums = new List<Forum>(); foreach (ForumResultSetForumsForumRow forum in listOfForums.Forums) { Forum newForum = new Forum(forum); _forums.Add(newForum); } } } } catch (WebException e) { if (e.Message.Contains("401")) { throw new AuthenticationException("Authentication Failed", e); } } _initialised = true; }