Beispiel #1
0
        public string GetExtension()
        {
            foreach (Type headerType in Assembly.GetExecutingAssembly().GetTypes().Where(type => type.BaseType == typeof(KnownHeader)))
            {
                KnownHeader header = (KnownHeader)Activator.CreateInstance(headerType);

                if (HeaderMatches(header))
                {
                    return(header.Extension);
                }
            }
            return("dat");
        }
Beispiel #2
0
 private bool HeaderMatches(KnownHeader header) => Contents.Take(header.Header.Length).SequenceEqual(header.Header);