Пример #1
0
        public Forum GetForum(string name, string locale)
        {
            var par = new RestParameters();

            par.Add("name", name);
            par.Add("locale", locale);
            var f = DoRequest <Response <Forum> >("forums/", par);

            if (f.Values.Count > 0)
            {
                return(f.Values[0]);
            }
            return(null);
        }
Пример #2
0
        public IEnumerable <Thread> GetThreads(Guid forumId, DateTime?from, bool ascending = true, Action <IEnumerable <Thread> > pageResult = null, int?maxPages = null)
        {
            var par = new RestParameters();

            par.Add("forumId", forumId.ToString());
            par.Add("sort", "createdDate");
            par.Add("order", ascending ? "asc" : "desc");
            if (from != null)
            {
                // TODO: Richtiges format!
                var dt = new DateTime(from.Value.Ticks, DateTimeKind.Utc);
                par.Add("contentChangeOrActionFrom", dt.ToString("o"));
            }
            var res = GetAllPages("threads/", par, pageResult, maxPages);

            return(res);
        }
Пример #3
0
        public IEnumerable <Thread> GetThreads(IEnumerable <Guid> threadIds, Action <IEnumerable <Thread> > pageResult = null)
        {
            var par = new RestParameters();

            par.Add("id", string.Join(",", threadIds));
            var res = GetAllPages("threads/", par, pageResult);

            return(res);
        }
Пример #4
0
        /// <summary>
        /// Returns the data of one forum
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Forum GetForum(Guid id)
        {
            var par = new RestParameters();

            par.Add("name", id.ToString());
            var f = DoRequest <Response <Forum> >("forums/", par);

            if (f.Values.Count > 0)
            {
                return(f.Values[0]);
            }
            return(null);
        }