コード例 #1
0
        public async Task GetShowsAsync(Action <IShowInfo> showHandler, CancellationToken cancellationToken)
        {
            if (showHandler == null)
            {
                throw new ArgumentNullException("showHandler");
            }

            using (var reader = await DataClient.ReadDataAsync(new Uri(@"http://epguides.com/common/allshows.txt"), cancellationToken))
            {
                await DataClient.ProcessRecordsAsync(reader, null, record =>
                {
                    var si = new ShowInfo
                    {
                        Title     = record[0],
                        Directory = record[1],
                        Country   = record[2],
                        TvRage    = record[3]
                    };
                    if (!string.IsNullOrWhiteSpace(si.TvRage) && !string.IsNullOrWhiteSpace(si.Title))
                    {
                        showHandler(si);
                    }
                }, "title", "directory", "country", "tvrage");
            }
        }
コード例 #2
0
ファイル: EpGuidesProvider.cs プロジェクト: ttrider/uEpisodes
        public async Task GetShowsAsync(Action<IShowInfo> showHandler, CancellationToken cancellationToken)
        {
            if (showHandler == null) throw new ArgumentNullException("showHandler");

            using (var reader = await DataClient.ReadDataAsync(new Uri(@"http://epguides.com/common/allshows.txt"), cancellationToken))
            {
                await DataClient.ProcessRecordsAsync(reader, null, record =>
                {
                    var si = new ShowInfo
                    {
                        Title = record[0],
                        Directory = record[1],
                        Country = record[2],
                        TvRage = record[3]
                    };
                    if (!string.IsNullOrWhiteSpace(si.TvRage) && !string.IsNullOrWhiteSpace(si.Title))
                    {
                        showHandler(si);
                    }
                }, "title", "directory", "country", "tvrage");
            }
        }