Ejemplo n.º 1
0
        private void olvFiles_SelectionChanged(object sender, EventArgs e)
        {
            IEnumerable <XfeFileInfo> files = olvFiles.SelectedObjects.Cast <XfeFileInfo>();
            var args = new FileSelectionChangedEventArgs
            {
                Files = files.ToList()
            };

            if (FileSelectionChanged != null)
            {
                FileSelectionChanged(this, args);
            }
        }
Ejemplo n.º 2
0
        private void _filesForm_FileSelectionChanged(object sender, FileSelectionChangedEventArgs eventArgs)
        {
            var errors = eventArgs.Files.SelectMany(f => f.ValidationErrors);

            _errors.SetErrors(errors);

            if (eventArgs.Files.Count != 1)
            {
                return;
            }
            var fileLocation = eventArgs.Files.First().FileInfo.FullName;
            var desc         = Descriptors.Select(descriptor => descriptor.GetAttributes(fileLocation)).SelectMany(items => items).ToDictionary(item => item.Key, item => item.Value);

            _descriptionForm.SetDictionary(desc);
        }