Esempio n. 1
0
        public async Task <bool> getProfile(double profile_uid, OnProfileLoaded complete, OnProfileError error)
        {
            // Формируем данные для отправки
            var formContent = new FormUrlEncodedContent(new[] {
                new KeyValuePair <string, string>("access_token", club_instance.auth.access_token),
                new KeyValuePair <string, string>("profile_uid", profile_uid.ToString()),
                new KeyValuePair <string, string>("lang", club_instance.language)
            });

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

            // Все ок
            return(true);
        }
 public void ProfileLoaded(ProfileData loadedProfile)
 {
     OnProfileLoaded?.Invoke(loadedProfile);
 }