コード例 #1
0
        public static string GetExtension(string assetPath, SupportedExtensions supported)
        {
            if (assetPath.IndexOf(".") == -1)
            {
                return("folder");
            }

            var supportedExtensions = supported.GetSupportedExtensions();
            var start = assetPath.LastIndexOf(".");

            if (start == -1)
            {
                return("unknown");
            }

            var possibleExtension = assetPath.Substring(start, assetPath.Length - start);

            possibleExtension = possibleExtension.ToLower();

            if (!supportedExtensions.Contains(possibleExtension))
            {
                return("unknown");
            }

            return(possibleExtension);
        }
コード例 #2
0
        public static string CategorizeExtension(string extension, SupportedExtensions supported)
        {
            var category = supported.GetCategory(extension);

            return(category);
        }