コード例 #1
0
ファイル: CommentMethods.cs プロジェクト: svick/stacky
 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);
 }
コード例 #2
0
ファイル: CommentMethods.cs プロジェクト: svick/stacky
 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);
 }
コード例 #3
0
ファイル: CommentMethods.cs プロジェクト: svick/stacky
 public virtual void GetAnswerComments(int answerId, Action<IPagedList<Comment>> onSuccess, Action<ApiException> onError, CommentsByPostOptions options)
 {
     GetAnswerComments(answerId.ToArray(), onSuccess, onError, options);
 }
コード例 #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);
 }
コード例 #5
0
 public virtual void GetAnswerComments(int answerId, Action <IPagedList <Comment> > onSuccess, Action <ApiException> onError, CommentsByPostOptions options)
 {
     GetAnswerComments(answerId.ToArray(), onSuccess, onError, options);
 }
コード例 #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);
 }
コード例 #7
0
ファイル: CommentMethods.cs プロジェクト: lfoust/stacky
 public virtual IPagedList <Comment> GetAnswerComments(int answerId, CommentsByPostOptions options)
 {
     return(GetAnswerComments(answerId.ToArray(), options));
 }
コード例 #8
0
ファイル: CommentMethods.cs プロジェクト: lfoust/stacky
        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));
        }
コード例 #9
0
ファイル: CommentMethods.cs プロジェクト: lfoust/stacky
 public virtual IPagedList <Comment> GetCommentsByPost(int postId, CommentsByPostOptions options)
 {
     return(GetCommentsByPost(postId.ToArray(), options));
 }