예제 #1
0
        private async Task GetSubscriptions()
        {
            Status = "Getting channels";
            //Contract.Assert(youRetriever != null && youRetriever.IsAuthorized);

            if (youRetriever == null || !youRetriever.IsAuthorized)
            {
                Status = "Yor arent authorized! Please, press Connect first";
                return;
            }

            Subscriptions.Clear();
            Subscriptions = new ObservableCollection <ChannelEx>();

            var subscriptions = await youRetriever.GetSubscriptions();

            var channels = await youRetriever.GetChannelsFromSubscriptions(subscriptions);

            await GetWatched();


            foreach (var channel in channels)
            {
                var ex = new ChannelEx {
                    Channel = channel
                };
                Subscriptions.Add(ex);
            }

            var channelEx = Subscriptions.FirstOrDefault();

            if (channelEx != null)
            {
                CurrentChannel = channelEx;
            }
            Status = "Channels list updated";
        }
예제 #2
0
        private async Task GetSubscriptions()
        {
            Status = "Getting channels";
            //Contract.Assert(youRetriever != null && youRetriever.IsAuthorized);

            if (youRetriever == null || !youRetriever.IsAuthorized)
            {
                Status = "Yor arent authorized! Please, press Connect first";
                return;
            }

            Subscriptions.Clear();
            Subscriptions = new ObservableCollection<ChannelEx>();

            var subscriptions = await youRetriever.GetSubscriptions();
            var channels = await youRetriever.GetChannelsFromSubscriptions(subscriptions);
            await GetWatched();


            foreach (var channel in channels)
            {
                var ex = new ChannelEx {Channel = channel};
                Subscriptions.Add(ex);
            }

            var channelEx = Subscriptions.FirstOrDefault();
            if (channelEx != null) CurrentChannel = channelEx;
            Status = "Channels list updated";
        }