Beispiel #1
0
        /// <summary>
        /// 创建下载器
        /// </summary>
        /// <param name="urlRelative"></param>
        /// <param name="urlAbsolute"></param>
        /// <param name="type"></param>
        /// <param name="param"></param>
        /// <returns></returns>
        public static ILoader CreateLoader(string urlRelative, string urlAbsolute, LoadType type = LoadType.AUTO, params LoadParam[] loadParams)
        {
            if (type == LoadType.AUTO)
            {
                type = GetLoadTypeByUrl(urlRelative);
            }

            ILoader loader = CreateLoader(type, urlRelative, urlAbsolute);

            foreach (LoadParam param in loadParams)
            {
                if (param is LoadParam)
                {
                    loader.AddParam(param);
                }
            }

            return(loader);
        }