Esempio n. 1
0
        public static FileFormat GetFileFormatNoUnknown(FilePath imageFilePath, IStringlyTypedPathOperator stringlyTypedPathOperator)
        {
            var fileFormat = ImageFileFormatOperator.GetFileFormatAllowUnknown(imageFilePath, stringlyTypedPathOperator);

            if (fileFormat == FileFormat.Unknown)
            {
                var fileExtension = stringlyTypedPathOperator.GetFileExtension(imageFilePath.Value);

                var message = EnumerationHelper.UnrecognizedEnumerationValueMessage <FileFormat>(fileExtension);
                throw new Exception(message);
            }

            return(fileFormat);
        }
Esempio n. 2
0
        public FileFormat GetFileFormat(FilePath imageFilePath)
        {
            var fileFormat = ImageFileFormatOperator.GetFileFormatNoUnknown(imageFilePath, this.StringlyTypedPathOperator);

            return(fileFormat);
        }
Esempio n. 3
0
        public string GetFileExtension(FileFormat fileFormat)
        {
            var fileExtension = ImageFileFormatOperator.GetFileExtensionNoUnknown(fileFormat);

            return(fileExtension);
        }