Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 public virtual void GetUserMentions(int userId, Action <IPagedList <Comment> > onSuccess, Action <ApiException> onError, UserOptions options)
 {
     GetUserMentions(new int[] { userId }, onSuccess, onError, options);
 }
Ejemplo n.º 4
0
 public virtual void GetUsers(IEnumerable <int> userIds, Action <IPagedList <User> > onSuccess, Action <ApiException> onError, UserOptions options)
 {
     GetUsers(onSuccess, onError, new string[] { userIds.Vectorize() }, options);
 }
Ejemplo n.º 5
0
 public virtual void GetUsers(Action <IPagedList <User> > onSuccess, Action <ApiException> onError, UserOptions options)
 {
     GetUsers(onSuccess, onError, null, options);
 }
Ejemplo n.º 6
0
 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);
 }
Ejemplo n.º 7
0
 public virtual IPagedList<User> GetUsers(IEnumerable<int> userIds, UserOptions options)
 {
     return GetUsers(options, new string[] { userIds.Vectorize() });
 }
Ejemplo n.º 8
0
 public virtual IPagedList<User> GetModerators(UserOptions options)
 {
     return GetUsers(options, new string[] { "moderators" });
 }
Ejemplo n.º 9
0
 public virtual IPagedList<User> GetUsers(UserOptions options)
 {
     return GetUsers(options, null);
 }