Esempio n. 1
0
        private void PopulateFileTypeCombo()
        {
            // not sure if this works
            FileFormat temp = FileFormat.bmp;

            cboFileType.Items.AddRange(System.Enum.GetNames(temp.GetType()));
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        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);
        }