Пример #1
0
        public async Task AddFilePathsAsync(IEnumerable <string> paths)
        {
            CanProcessing.Value = false;

            await Task.Run(() =>
            {
                foreach (var path in paths)
                {
                    CancellationToken.ThrowIfCancellationRequested();

                    if (FilePaths.Contains(path) || !File.Exists(path))
                    {
                        continue;
                    }

                    try
                    {
                        using (var bmp = new Bitmap(path))
                        { }
                    }
                    catch (Exception)
                    {
                        continue;
                    }

                    FilePaths.AddOnScheduler(path);
                }
            }, CancellationToken);

            CanProcessing.Value = true;
        }