protected override UtilityInterface.IService <KeyValuePair <DynamicData.ChangeReason, IWorkerItem <object> > > NewItemsInitialise(IObservable <object> newitems) { Check(newitems); var nis = NewItemSubject.Select(_ => { var uri = _.GetPropValue <Uri>(Uri); var path = _.GetPropValue <string>(Path); return(Tuple.Create(uri, path)); }); return(new FileDownloaderCommandQueue(nis)); }
protected override UtilityInterface.IService <KeyValuePair <DynamicData.ChangeReason, AsyncWorkerItem <object> > > NewItemsInitialise(IObservable <object> newitems) { Check(newitems); var nis = NewItemSubject.Select(_ => { var task = _.GetPropValue <Task <object> >(Task); var key = _.GetPropValue <string>(Key); return(new KeyValuePair <string, Task <object> >(key, (task))); }); var cts = new System.Threading.CancellationTokenSource(); var scheduler = TaskScheduler.FromCurrentSynchronizationContext(); return(new TPLDataFlowAsyncQueue <object>(nis, cts, scheduler)); }