public static async Task <ReviewPatientCollection> ReadDirectoryAsync(DirectoryInfo folder)
        {
            var items = new ReviewPatientCollection();

            foreach (var file in folder.GetFiles("*.pdf", SearchOption.AllDirectories))
            {
                var item = await ReviewPatient.ParseAsync(file);

                if (!(item is null) && !item.IsNull)
                {
                    items.Collection.Add(item);
                }
Ejemplo n.º 2
0
        private async Task ScanDirectoryAsync(DirectoryInfo directory)
        {
            if (_data.ContainsKey(directory))
            {
                _data.Remove(directory);
            }
            _data[directory] = await ReviewPatientCollection.ReadDirectoryAsync(directory);

            foreach (var msg in _data[directory].Errors)
            {
                LogMessage(msg, LogType.Error);
            }
        }
        public static ReviewPatientCollection ReadDirectory(DirectoryInfo folder)
        {
            var items = new ReviewPatientCollection();

            foreach (var file in folder.GetFiles("*.pdf", SearchOption.AllDirectories))
            {
                if (ReviewPatient.TryParse(file, out var reviewPatient))
                {
                    items.Collection.Add(reviewPatient);
                }
            }
            return(items);
        }
Ejemplo n.º 4
0
 private void ScanDirectory(DirectoryInfo directory)
 {
     _data.Remove(directory);
     _data[directory] = ReviewPatientCollection.ReadDirectory(directory);
 }