Esempio n. 1
0
        protected override async Task <DocumentSet> LoadLogic(CancellationToken token)
        {
            var fileManager = fileManagerFactory.Create(token);
            var tracking    = fileManager.ProgressUpdate
                              .Select(item => item)
                              .ToProperty(this, model => model.Progress);

            using (tracking)
            {
                progress = tracking;
                var result = await fileManager.LoadAll(new DirectoryInfo(Select.Path)).ConfigureAwait(false);

                if (token.IsCancellationRequested)
                {
                    return(await LoadData().ConfigureAwait(false));
                }

                progress = null;
                return(result);
            }
        }