Esempio n. 1
0
 public virtual void GetCommentsByPost(IEnumerable<int> postIds, Action<IPagedList<Comment>> onSuccess, Action<ApiException> onError, CommentsByPostOptions options)
 {
     MakeRequest<CommentResponse>("posts", new string[] { postIds.Vectorize(), "comments" }, new
     {
         key = apiKey,
         page = options.Page ?? null,
         pagesize = options.PageSize ?? null,
         fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
         todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
         sort = options.SortBy.ToString().ToLower(),
         order = GetSortDirection(options.SortDirection),
     }, (items) => onSuccess(new PagedList<Comment>(items.Comments, items)), onError);
 }
Esempio n. 2
0
 public virtual void GetAnswerComments(IEnumerable<int> answerIds, Action<IPagedList<Comment>> onSuccess, Action<ApiException> onError, CommentsByPostOptions options)
 {
     MakeRequest<CommentResponse>("answers", new string[] { answerIds.Vectorize(), "comments" }, new
     {
         key = apiKey,
         page = options.Page ?? null,
         pagesize = options.PageSize ?? null,
         fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
         todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
         sort = options.SortBy.ToString().ToLower(),
         order = GetSortDirection(options.SortDirection),
         min = options.Min ?? null,
         max = options.Max ?? null
     }, response => onSuccess(new PagedList<Comment>(response.Comments, response)), onError);
 }
Esempio n. 3
0
 public virtual void GetAnswerComments(int answerId, Action<IPagedList<Comment>> onSuccess, Action<ApiException> onError, CommentsByPostOptions options)
 {
     GetAnswerComments(answerId.ToArray(), onSuccess, onError, options);
 }
Esempio n. 4
0
 public virtual void GetAnswerComments(IEnumerable <int> answerIds, Action <IPagedList <Comment> > onSuccess, Action <ApiException> onError, CommentsByPostOptions options)
 {
     MakeRequest <CommentResponse>("answers", new string[] { answerIds.Vectorize(), "comments" }, new
     {
         key      = apiKey,
         page     = options.Page ?? null,
         pagesize = options.PageSize ?? null,
         fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
         todate   = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
         sort     = options.SortBy.ToString().ToLower(),
         order    = GetSortDirection(options.SortDirection),
         min      = options.Min ?? null,
         max      = options.Max ?? null
     }, response => onSuccess(new PagedList <Comment>(response.Comments, response)), onError);
 }
Esempio n. 5
0
 public virtual void GetAnswerComments(int answerId, Action <IPagedList <Comment> > onSuccess, Action <ApiException> onError, CommentsByPostOptions options)
 {
     GetAnswerComments(answerId.ToArray(), onSuccess, onError, options);
 }
Esempio n. 6
0
 public virtual void GetCommentsByPost(IEnumerable <int> postIds, Action <IPagedList <Comment> > onSuccess, Action <ApiException> onError, CommentsByPostOptions options)
 {
     MakeRequest <CommentResponse>("posts", new string[] { postIds.Vectorize(), "comments" }, new
     {
         key      = apiKey,
         page     = options.Page ?? null,
         pagesize = options.PageSize ?? null,
         fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
         todate   = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
         sort     = options.SortBy.ToString().ToLower(),
         order    = GetSortDirection(options.SortDirection),
     }, (items) => onSuccess(new PagedList <Comment>(items.Comments, items)), onError);
 }
Esempio n. 7
0
 public virtual IPagedList <Comment> GetAnswerComments(int answerId, CommentsByPostOptions options)
 {
     return(GetAnswerComments(answerId.ToArray(), options));
 }
Esempio n. 8
0
        public virtual IPagedList <Comment> GetCommentsByPost(IEnumerable <int> postIds, CommentsByPostOptions options)
        {
            var response = MakeRequest <CommentResponse>("posts", new string[] { postIds.Vectorize(), "comments" }, new
            {
                key      = apiKey,
                page     = options.Page ?? null,
                pagesize = options.PageSize ?? null,
                fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
                todate   = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
                sort     = options.SortBy.ToString().ToLower(),
                order    = GetSortDirection(options.SortDirection),
            });

            return(new PagedList <Comment>(response.Comments, response));
        }
Esempio n. 9
0
 public virtual IPagedList <Comment> GetCommentsByPost(int postId, CommentsByPostOptions options)
 {
     return(GetCommentsByPost(postId.ToArray(), options));
 }