Exemplo n.º 1
0
        /// <summary>
        /// Get supported file info by type. Supports 1 level of inheritance.
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public static SupportedFileInfo GetSupportedFileInfo(Type type)
        {
            var info = SupportedFileInfos.FirstOrDefault(x => x.ClassType == type);

            while (info == null)
            {
                info = SupportedFileInfos.FirstOrDefault(x => x.ClassType.BaseType == type);
            }

            return(info);
        }
Exemplo n.º 2
0
 public static SupportedFileInfo GetSupportedFileInfo(string extension)
 {
     return(SupportedFileInfos.Single(x => x.Extensions.Contains(extension, StringComparer.InvariantCultureIgnoreCase)));
 }
Exemplo n.º 3
0
 public static SupportedFileInfo GetSupportedFileInfo(SupportedFileType type)
 {
     return(SupportedFileInfos.Single(x => x.EnumType == type));
 }