Beispiel #1
0
        public static bool TryParseName(string name, out FileTypeInfo result)
        {
            if (name == null)
            {
                result = null;  return(false);
            }
            var ident = name.ToLower().TrimStart('.');

            result = Types.FirstOrDefault(i => i.Extension == ident || i.Name == ident);
            return(result != null);
        }
Beispiel #2
0
 public static bool TryParseFromExtension(string path, out FileTypeInfo result)
 {
     return(TryParseName(System.IO.Path.GetExtension(path), out result));
 }