private void CreateProfile(Type profileType)
        {
            try
            {
                //string AppPath = Assembly.GetExecutingAssembly().GetName().Name;
                //string FullActionType = AppPath + ".Action." + ActionType;
                //Type objType = Type.GetType(FullActionType, true);
                var obj = Activator.CreateInstance(profileType, _assembly);

                Profile = (BaseProfile)obj;
            }
            catch (Exception ex)
            {
                Log.Error($"创建Profile with Type{profileType}失败{ex}.");
            }
        }
Exemplo n.º 2
0
        private static void AddCustomizedType(BaseProfile profile)
        {
            var customizedTypes = profile.GetAllCustomizedTypes();

            //初始化类型池
            foreach (var customizedType in customizedTypes)
            {
                var customizedTypeCollection = new CustomTypeCollection(customizedType.Name);
                CustomTypeManager.AddCustomizedTypeCollection(customizedType.Name,
                                                              customizedTypeCollection);

                CustomTypeManager.AddCustomizedType(customizedType.Name, customizedType);


                //加到注册表
                ResourceClassRegister.AddCustomizedType(customizedType.Name, customizedType.FullName,
                                                        profile.GetPackageName());
            }
        }
 public void AddOtherPackage(BaseProfile Profile)
 {
     OtherPackages.Add(Profile);
 }