Пример #1
0
        async void load_disco()
        {
            Exception exception = null;

            //music_list = new ObservableCollection<Music>();
            //pack_list = new ObservableCollection<Pack>();
            album_list = new ObservableCollection<Album>();

            music_own = new MusicOwnByUser();

            try
            {
                music_own = (MusicOwnByUser)await Http_get.get_object(new MusicOwnByUser(), "/users/getmusics?user_id=" + Singleton.Instance.Current_user.id.ToString() + "&secureKey=" + await Security.getSecureKey(Singleton.Instance.Current_user.id.ToString()));

                foreach (var item in music_own.albums)
                {
                    item.image = Singleton.Instance.url + "/assets/albums/" + item.image;
                    album_list.Add(item);
                }

            }
            catch (Exception e)
            {
                exception = e;
            }

            if (exception != null)
                await new MessageDialog(exception.Message, "Erreur lors de la récupération de la discothèque").ShowAsync();
        }
Пример #2
0
        async void load_music_own()
        {
            Exception exception = null;
            music_own = new MusicOwnByUser();

            try
            {
                music_own = (MusicOwnByUser)await Http_get.get_object(new MusicOwnByUser(), "/users/getmusics?user_id=" + Singleton.Instance.Current_user.id.ToString() + "&secureKey=" + await Security.getSecureKey(Singleton.Instance.Current_user.id.ToString()));
            }
            catch (Exception e)
            {
                exception = e;
            }

            if (exception != null)
                await new MessageDialog(exception.Message, "Erreur lors de la récupération de la musique de l'utilisateur").ShowAsync();
        }