Exemple #1
0
        /// <summary>
        /// 依赖关系解析
        /// </summary>
        /// <param name="bundles"></param>
        /// <returns></returns>
        protected override bool ResolveDependent(IList <AbstractBundle> bundles)
        {
            // 构造解析树
            ResolverTree tree = ResolverTree.Parse(framework, this, bundles);

            // 如果构造失败,则清空集合,解析失败
            if (tree == null)
            {
                bundles.Clear();
                return(false);
            }
            // 获取有序的已解析的插件类表
            IList <AbstractBundle> newBundles = tree.QueryBundlesInOrder();

            if (newBundles == null || newBundles.Count == 0)
            {
                bundles.Clear();
                return(false);
            }
            // 清空当前集合列表
            bundles.Clear();
            BundleUtil.Combine(bundles, newBundles);

            return(true);
        }