コード例 #1
0
 private IPagedList<User> GetUsers(UserOptions options, string[] urlParameters)
 {
     var response = MakeRequest<UserResponse>("users", urlParameters, new
     {
         key = apiKey,
         page = options.Page ?? null,
         pagesize = options.PageSize ?? null,
         filter = options.Filter,
         sort = options.SortBy.ToString().ToLower(),
         order = GetSortDirection(options.SortDirection),
         fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
         todate = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
         min = options.Min ?? null,
         max = options.Max ?? null
     });
     return new PagedList<User>(response.Users, response);
 }
コード例 #2
0
ファイル: UserMethods.cs プロジェクト: lfoust/stacky
 public virtual void GetUserMentions(IEnumerable <int> userIds, Action <IPagedList <Comment> > onSuccess, Action <ApiException> onError, UserOptions options)
 {
     MakeRequest <CommentResponse>("users", new string[] { userIds.Vectorize(), "mentioned" }, new
     {
         key      = apiKey,
         page     = options.Page ?? null,
         pagesize = options.PageSize ?? null,
         filter   = options.Filter,
         sort     = options.SortBy.ToString().ToLower(),
         order    = GetSortDirection(options.SortDirection),
         fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
         todate   = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
         min      = options.Min ?? null,
         max      = options.Max ?? null
     }, (items) => onSuccess(new PagedList <Comment>(items.Comments, items)), onError);
 }
コード例 #3
0
ファイル: UserMethods.cs プロジェクト: lfoust/stacky
 public virtual void GetUserMentions(int userId, Action <IPagedList <Comment> > onSuccess, Action <ApiException> onError, UserOptions options)
 {
     GetUserMentions(new int[] { userId }, onSuccess, onError, options);
 }
コード例 #4
0
ファイル: UserMethods.cs プロジェクト: lfoust/stacky
 public virtual void GetUsers(IEnumerable <int> userIds, Action <IPagedList <User> > onSuccess, Action <ApiException> onError, UserOptions options)
 {
     GetUsers(onSuccess, onError, new string[] { userIds.Vectorize() }, options);
 }
コード例 #5
0
ファイル: UserMethods.cs プロジェクト: lfoust/stacky
 public virtual void GetUsers(Action <IPagedList <User> > onSuccess, Action <ApiException> onError, UserOptions options)
 {
     GetUsers(onSuccess, onError, null, options);
 }
コード例 #6
0
ファイル: UserMethods.cs プロジェクト: lfoust/stacky
 private void GetUsers(Action <IPagedList <User> > onSuccess, Action <ApiException> onError, string[] urlParameters, UserOptions options)
 {
     MakeRequest <UserResponse>("users", urlParameters, new
     {
         key      = apiKey,
         page     = options.Page ?? null,
         pagesize = options.PageSize ?? null,
         filter   = options.Filter,
         sort     = options.SortBy.ToString().ToLower(),
         order    = GetSortDirection(options.SortDirection),
         fromdate = options.FromDate.HasValue ? (long?)options.FromDate.Value.ToUnixTime() : null,
         todate   = options.ToDate.HasValue ? (long?)options.ToDate.Value.ToUnixTime() : null,
         min      = options.Min ?? null,
         max      = options.Max ?? null
     }, (items) => onSuccess(new PagedList <User>(items.Users, items)), onError);
 }
コード例 #7
0
 public virtual IPagedList<User> GetUsers(IEnumerable<int> userIds, UserOptions options)
 {
     return GetUsers(options, new string[] { userIds.Vectorize() });
 }
コード例 #8
0
 public virtual IPagedList<User> GetModerators(UserOptions options)
 {
     return GetUsers(options, new string[] { "moderators" });
 }
コード例 #9
0
 public virtual IPagedList<User> GetUsers(UserOptions options)
 {
     return GetUsers(options, null);
 }