Ejemplo n.º 1
0
        public IEnumerable <User> GetUsersFuzzy(
            string fuzzyName      = null,
            int?elementsPerPage   = null,
            UsersOrdering orderBy = default(UsersOrdering))
        {
            var parameters = new List <string>();

            if (!string.IsNullOrEmpty(fuzzyName))
            {
                parameters.Add(string.Format("lookup={0}",
                                             Uri.EscapeDataString(fuzzyName)));
            }

            if (elementsPerPage.HasValue)
            {
                parameters.Add(string.Format("max={0}", elementsPerPage));
            }

            parameters.AddRange(orderBy.ToParameters());

            var uri = GetUsersUri(parameters.ToParameters());

            return(baseClient.DoPaginatedRequest(uri,
                                                 x => User.Parse(baseClient, x) as User));
        }
Ejemplo n.º 2
0
        public IEnumerable <User> GetUsers(
            string name           = null,
            string twitch         = null, string hitbox        = null,
            string twitter        = null, string speedrunslive = null,
            int?elementsPerPage   = null,
            UsersOrdering orderBy = default(UsersOrdering))
        {
            var parameters = new List <string>();

            if (!string.IsNullOrEmpty(name))
            {
                parameters.Add(string.Format("name={0}",
                                             Uri.EscapeDataString(name)));
            }

            if (!string.IsNullOrEmpty(twitch))
            {
                parameters.Add(string.Format("twitch={0}",
                                             Uri.EscapeDataString(twitch)));
            }

            if (!string.IsNullOrEmpty(hitbox))
            {
                parameters.Add(string.Format("hitbox={0}",
                                             Uri.EscapeDataString(hitbox)));
            }

            if (!string.IsNullOrEmpty(twitter))
            {
                parameters.Add(string.Format("twitter={0}",
                                             Uri.EscapeDataString(twitter)));
            }

            if (!string.IsNullOrEmpty(speedrunslive))
            {
                parameters.Add(string.Format("speedrunslive={0}",
                                             Uri.EscapeDataString(speedrunslive)));
            }

            if (elementsPerPage.HasValue)
            {
                parameters.Add(string.Format("max={0}", elementsPerPage));
            }

            parameters.AddRange(orderBy.ToParameters());

            var uri = GetUsersUri(parameters.ToParameters());

            return(baseClient.DoPaginatedRequest(uri,
                                                 x => User.Parse(baseClient, x) as User));
        }
Ejemplo n.º 3
0
        public IEnumerable<User> GetUsers(
            string name = null, 
            string twitch = null, string hitbox = null, 
            string twitter = null, string speedrunslive = null, 
            int? elementsPerPage = null,
            UsersOrdering orderBy = default(UsersOrdering))
        {
            var parameters = new List<string>();

            if (!string.IsNullOrEmpty(name))
                parameters.Add(string.Format("name={0}",
                    Uri.EscapeDataString(name)));

            if (!string.IsNullOrEmpty(twitch))
                parameters.Add(string.Format("twitch={0}",
                    Uri.EscapeDataString(twitch)));

            if (!string.IsNullOrEmpty(hitbox))
                parameters.Add(string.Format("hitbox={0}",
                    Uri.EscapeDataString(hitbox)));

            if (!string.IsNullOrEmpty(twitter))
                parameters.Add(string.Format("twitter={0}",
                    Uri.EscapeDataString(twitter)));

            if (!string.IsNullOrEmpty(speedrunslive))
                parameters.Add(string.Format("speedrunslive={0}",
                    Uri.EscapeDataString(speedrunslive)));

            if (elementsPerPage.HasValue)
                parameters.Add(string.Format("max={0}", elementsPerPage));

            parameters.AddRange(orderBy.ToParameters());

            var uri = GetUsersUri(parameters.ToParameters());
            return baseClient.DoPaginatedRequest(uri,
                x => User.Parse(baseClient, x) as User);
        }
Ejemplo n.º 4
0
        public IEnumerable<User> GetUsersFuzzy(
            string fuzzyName = null,
            int? elementsPerPage = null,
            UsersOrdering orderBy = default(UsersOrdering))
        {
            var parameters = new List<string>();

            if (!string.IsNullOrEmpty(fuzzyName))
                parameters.Add(string.Format("lookup={0}",
                    Uri.EscapeDataString(fuzzyName)));

            if (elementsPerPage.HasValue)
                parameters.Add(string.Format("max={0}", elementsPerPage));

            parameters.AddRange(orderBy.ToParameters());

            var uri = GetUsersUri(parameters.ToParameters());
            return baseClient.DoPaginatedRequest(uri,
                x => User.Parse(baseClient, x) as User);
        }