Пример #1
0
        /// <summary>
        /// 初始化
        /// </summary>
        public void Init()
        {
            log.Debug("框架初始化开始!");

            Assembly selfAssembly = typeof(Framework).Assembly;

            //将自身Bundle程序集提供程序
            BundleAssemblyProvider.AddAssembly(selfAssembly.GetName().Name, selfAssembly);

            //读取配置文件
            this.ReadConfig();

            //将自身加入Bundle集合
            this.bundleList.Add(this);

            //加载共享程序集目录dll
            this.LoadShareAssemblys();

            //发现目录中的Bundle集合
            this.DiscoverBundles();

            log.Debug("框架初始化结束!");

            this.state = BundleStateConst.RESOLVED;

            this.FireBundleEvent(new BundleEventArgs(BundleEventArgs.RESOLVED, this));
        }
Пример #2
0
 /// <summary>
 /// 添加引用程序集
 /// </summary>
 /// <param name="assemblyFullName"></param>
 /// <param name="assemblyDefinition"></param>
 /// <param name="assembly"></param>
 private void AddRefAssembly(string assemblyFullName, Assembly assembly, AssemblyDefinition assemblyDefinition)
 {
     if (!bundleRefAssemblyDict.ContainsKey(assemblyFullName))
     {
         bundleRefAssemblyDict.Add(assemblyFullName, assembly);
         bundleRefDefinitionDict.Add(assemblyFullName, assemblyDefinition);
     }
     BundleAssemblyProvider.AddAssembly(assemblyFullName, assembly);
 }