BelhardTraining.LessonIO.MainForm.GetFileProperties C# (CSharp) Метод

GetFileProperties() приватный статический Метод

private static GetFileProperties ( string fileName ) : ReadOnlyCollection
fileName string
Результат ReadOnlyCollection
        private static ReadOnlyCollection<FileProperty> GetFileProperties(string fileName)
        {
            //var camera = GetValue(picture.Properties.GetProperty(SystemProperties.System.Photo.CameraModel));
            //var company = GetValue(picture.Properties.GetProperty(SystemProperties.System.Photo.CameraManufacturer));

            var properties = new List<FileProperty>();
            using (ShellObject shellObject = ShellObject.FromParsingName(fileName))
            {
                foreach (var shellProperty in shellObject.Properties.DefaultPropertyCollection)
                {
                    string value = GetValue(shellProperty);
                    if (string.IsNullOrEmpty(value) || shellProperty.CanonicalName == null) continue;

                    properties.Add(new FileProperty(
                                shellProperty.CanonicalName,
                                shellProperty.Description.DisplayName,
                                GetValue(shellProperty)
                            )
                    );
                }
            }

            properties.Sort((x, y) => string.CompareOrdinal(x.CanonicalName, y.CanonicalName));

            return properties.AsReadOnly();
        }