Chirp.Radio.PlaylistRequestHelper.GetUpdatedPlaylist C# (CSharp) Method

GetUpdatedPlaylist() public method

public GetUpdatedPlaylist ( ) : void
return void
        public void GetUpdatedPlaylist()
        {
            var client = new WebClient();
            client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
            client.DownloadStringAsync(new Uri(_playlistUrl, UriKind.Absolute));
        }

Usage Example

        public MainPage()
        {
            InitializeComponent();
            BackgroundAudioPlayer.Instance.PlayStateChanged += new EventHandler(Instance_PlayStateChanged);

            timer = new DispatcherTimer();
            timer.Interval = new TimeSpan(0, 0, 1);
            timer.Tick += new EventHandler(timer_Tick);
            // delay starting the timer until we get the first response so we don't get multiple
            // error boxes if there's no internet connection
            //timer.Start();

            _requestHelper = new PlaylistRequestHelper();
            _requestHelper.RequestCompleted += new RequestCompletedHandler(requestHelper_RequestCompleted);
            _requestHelper.GetUpdatedPlaylist();

            _viewModel = new PlaylistViewModel();
            _viewModel.LoadDataCommand.Execute(null);
            this.DataContext = _viewModel;
        }