Exemplo 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);
        }
Exemplo n.º 2
0
        public FileFormat GetFileFormat(FilePath imageFilePath)
        {
            var fileFormat = ImageFileFormatOperator.GetFileFormatNoUnknown(imageFilePath, this.StringlyTypedPathOperator);

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

            return(fileExtension);
        }