public static SupportedExtensions ParseExtension(string extension) { SupportedExtensions ext = SupportedExtensions.DDS; string tempext = Path.GetExtension(extension).Replace(".", ""); if (!Enum.TryParse(tempext, true, out ext)) return SupportedExtensions.UNKNOWN; return ext; }