예제 #1
0
        private IGalleryObjectMetadataItem GetLightSourceMetadataItem()
        {
            IGalleryObjectMetadataItem mdi = null;
            MetadataItem rawMdi            = null;

            if (RawMetadata.TryGetValue(RawMetadataItemName.ExifLightSource, out rawMdi))
            {
                if (rawMdi.ExtractedValueType == ExtractedValueType.Int64)
                {
                    LightSource lightSource = (LightSource)(Int64)rawMdi.Value;
                    if (MetadataEnumHelper.IsValidLightSource(lightSource))
                    {
                        // Don't bother with it if it is "Unknown"
                        if (lightSource != LightSource.Unknown)
                        {
                            mdi = new GalleryObjectMetadataItem(int.MinValue, FormattedMetadataItemName.LightSource, Resources.Metadata_LightSource, lightSource.ToString(), true);
                        }
                    }
                }
            }
            return(mdi);
        }