Exemple #1
0
 public virtual void GetUsers(Action <IPagedList <User> > onSuccess, Action <ApiException> onError, UserSort sortBy = UserSort.Reputation, SortDirection sortDirection = SortDirection.Descending, int?page = null, int?pageSize = null, string filter = null)
 {
     MakeRequest <UserResponse>("users", null, new
     {
         key      = apiKey,
         page     = page ?? null,
         pagesize = pageSize ?? null,
         filter   = filter,
         sort     = sortBy.ToString().ToLower(),
         order    = GetSortDirection(sortDirection)
     }, (items) => onSuccess(new PagedList <User>(items.Users, items)), onError);
 }
Exemple #2
0
 public virtual void GetUsers(Action<IPagedList<User>> onSuccess, Action<ApiException> onError = null, UserSort sortBy = UserSort.Reputation, SortDirection sortDirection = SortDirection.Descending, int? page = null, int? pageSize = null, string filter = null)
 {
     MakeRequest<UserResponse>("users", null, new
     {
         key = apiKey,
         page = page ?? null,
         pagesize = pageSize ?? null,
         filter = filter,
         sort = sortBy.ToString().ToLower(),
         order = GetSortDirection(sortDirection)
     }, (items) => onSuccess(new PagedList<User>(items.Users, items)), onError);
 }
Exemple #3
0
 public virtual void GetModerators(Action <IPagedList <User> > onSuccess, Action <ApiException> onError, int?page = null, int?pageSize = null, UserSort sortBy = UserSort.Reputation, SortDirection sortDirection = SortDirection.Descending, string filter = null, DateTime?fromDate = null, DateTime?toDate = null)
 {
     MakeRequest <UserResponse>("users", new string[] { "moderators" }, new
     {
         key      = apiKey,
         page     = page ?? null,
         pagesize = pageSize ?? null,
         filter   = filter,
         sort     = sortBy.ToString().ToLower(),
         order    = GetSortDirection(sortDirection),
         fromdate = fromDate.HasValue ? (long?)fromDate.Value.ToUnixTime() : null,
         todate   = toDate.HasValue ? (long?)toDate.Value.ToUnixTime() : null
     }, (response) => onSuccess(new PagedList <User>(response.Users, response)), onError);
 }
Exemple #4
0
 public virtual IPagedList<User> GetModerators(int? page = null, int? pageSize = null, UserSort sortBy = UserSort.Reputation, SortDirection sortDirection = SortDirection.Descending, string filter = null, DateTime? fromDate = null, DateTime? toDate = null)
 {
     var response = MakeRequest<UserResponse>("users", new string[] { "moderators" }, new
     {
         key = apiKey,
         page = page ?? null,
         pagesize = pageSize ?? null,
         filter = filter,
         sort = sortBy.ToString().ToLower(),
         order = GetSortDirection(sortDirection),
         fromdate = fromDate.HasValue ? (long?)fromDate.Value.ToUnixTime() : null,
         todate = toDate.HasValue ? (long?)toDate.Value.ToUnixTime() : null
     });
     return new PagedList<User>(response.Users, response);
 }
Exemple #5
0
        public virtual IPagedList <User> GetModerators(int?page = null, int?pageSize = null, UserSort sortBy = UserSort.Reputation, SortDirection sortDirection = SortDirection.Descending, string filter = null, DateTime?fromDate = null, DateTime?toDate = null)
        {
            var response = MakeRequest <UserResponse>("users", new string[] { "moderators" }, new
            {
                key      = apiKey,
                page     = page ?? null,
                pagesize = pageSize ?? null,
                filter   = filter,
                sort     = sortBy.ToString().ToLower(),
                order    = GetSortDirection(sortDirection),
                fromdate = fromDate.HasValue ? (long?)fromDate.Value.ToUnixTime() : null,
                todate   = toDate.HasValue ? (long?)toDate.Value.ToUnixTime() : null
            });

            return(new PagedList <User>(response.Users, response));
        }
Exemple #6
0
 public virtual void GetModerators(Action<IPagedList<User>> onSuccess, Action<ApiException> onError, int? page = null, int? pageSize = null, UserSort sortBy = UserSort.Reputation, SortDirection sortDirection = SortDirection.Descending, string filter = null, DateTime? fromDate = null, DateTime? toDate = null)
 {
     MakeRequest<UserResponse>("users", new string[] { "moderators" }, new
     {
         key = apiKey,
         page = page ?? null,
         pagesize = pageSize ?? null,
         filter = filter,
         sort = sortBy.ToString().ToLower(),
         order = GetSortDirection(sortDirection),
         fromdate = fromDate.HasValue ? (long?)fromDate.Value.ToUnixTime() : null,
         todate = toDate.HasValue ? (long?)toDate.Value.ToUnixTime() : null
     }, (response) => onSuccess(new PagedList<User>(response.Users, response)), onError);
 }