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"); } }
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"); } }