private void PopulateFileTypeCombo() { // not sure if this works FileFormat temp = FileFormat.bmp; cboFileType.Items.AddRange(System.Enum.GetNames(temp.GetType())); }
static void WriteFingerprint(FileFormat fingerprint) { var contentTypes = string.Join(", ", fingerprint.ContentTypes); var extensions = string.Join(", ", fingerprint.Extensions); Console.WriteLine($"Class : {fingerprint.GetType().Name}"); Console.WriteLine($"Content Types : {contentTypes}"); Console.WriteLine($"Extensions : {extensions}"); Console.WriteLine(); }
public static bool IsKnown(FileFormat format) { if (format == null) { return(false); } Type formatType = format.GetType(); foreach (var f in GetAllFormats()) { if (f.GetType() == formatType) { return(true); } } return(false); }