Esempio n. 1
0
        /* Конструктор Класса */
        public Games(Club instance, string route = "/profile/")
        {
            // Задаем параметры
            club_instance = instance; // Передача экземпляра
            api_route     = route;    // Передача маршрута

            // Создаем модели данных
            list      = new gamesModel();                            // Создать модель новостей
            list.list = new Dictionary <string, gamesListElement>(); // Создать список
        }
Esempio n. 2
0
        public async Task <bool> getGamesList(double page, string search, OnGamesListLoaded complete, OnGamesListError error)
        {
            // Формируем данные для отправки
            var formContent = new FormUrlEncodedContent(new[] {
                new KeyValuePair <string, string>("access_token", club_instance.auth.access_token),
                new KeyValuePair <string, string>("page", page.ToString()),
                new KeyValuePair <string, string>("lang", club_instance.language)
            });

            // Отправка запроса
            bool getList = await club_instance.requests.sendRequest(api_route + "get_my_games/", formContent, ((string data) => {
                list = JsonConvert.DeserializeObject <gamesModel>(data); // Конверсия JSON
                complete();
            }), ((string code) => {
                error(code);
            }));

            // Все ок
            return(true);
        }