Example #1
0
        private void RefreshTags(CancellationToken token)
        {
            var task = Task.Factory.StartNew <TagRefiner>(() => this.Component.GetTagRefiner());

            task.ContinueWith(t =>
            {
                this.TagRefiner = t.Result;
                var result      = Mapper.Map <IEnumerable <TagDto>, IEnumerable <TagViewModel> >(t.Result.Items);
                this.ViewModel.Tags.Refill(result);
                this.ViewModel.IsTagBusy = false;
            }, token, TaskContinuationOptions.OnlyOnRanToCompletion, this.Scheduler);
            task.ContinueWith(t => this.Handle.Error(t.Exception), token, TaskContinuationOptions.OnlyOnFaulted, this.Scheduler);
        }
 private void RefreshTags(CancellationToken token)
 {
     var task = Task.Factory.StartNew<TagRefiner>(() => this.Component.GetTagRefiner());
     task.ContinueWith(t =>
     {
         this.TagRefiner = t.Result;
         var result = Mapper.Map<IEnumerable<TagDto>, IEnumerable<TagViewModel>>(t.Result.Items);
         this.ViewModel.Tags.Refill(result);
         this.ViewModel.IsTagBusy = false;
     }, token, TaskContinuationOptions.OnlyOnRanToCompletion, this.Scheduler);
     task.ContinueWith(t => this.Handle.Error(t.Exception), token, TaskContinuationOptions.OnlyOnFaulted, this.Scheduler);
 }