Beispiel #1
0
 /// <summary>
 /// 重载内部信息
 /// </summary>
 public virtual void Reload()
 {
     if (ManagedAssembly == null)
     {
         throw new NullReferenceException("ManagedAssembly must be setted");
     }
     Extensions = from type in ManagedAssembly.GetTypes()
                  where IsExt(type)
                  select CreateExtensionInfo(type);
 }
Beispiel #2
0
        public virtual void RefreshExtensions()
        {
            //Emtpy exist extensions record
            if (Extensions != null)
            {
                foreach (var ext in Extensions)
                {
                    var rext = new RegisteredExtensionInfo(ext, this);
                    LakeProvider.Lake.Get <ILibsManager>().Registry.Remove(rext);
                }
            }

            //Rescan and load
            Extensions = from type in ManagedAssembly.GetTypes()
                         where IsExt(type)
                         select CreateExtensionInfo(type);

            foreach (var ext in Extensions)
            {
                var rext = new RegisteredExtensionInfo(ext, this);
                LakeProvider.Lake.Get <ILibsManager>().Registry.Add(rext);
            }
        }
Beispiel #3
0
 /// <summary>
 /// 获取符合条件的拓展模块类型
 /// </summary>
 /// <returns></returns>
 protected virtual IEnumerable <Type> GetExtTypes()
 {
     return(from type in ManagedAssembly.GetTypes()
            where IsExt(type)
            select type);
 }