/// <summary> /// 初始化PortalService /// </summary> /// <param name="provider"></param> /// <param name="exAssemblyNames"></param> /// <param name="exceptTypes"></param> /// <returns></returns> public static bool Initialize(IPortalServiceProvider provider, string assemblyNames, string[] exAssemblyNames, params Type[] exceptTypes) { Assembly[] assemblies = ObjectHelper.GetAssemblysByNames(assemblyNames); Assembly[] exAssemblies = ObjectHelper.GetAssemblysByNames(exAssemblyNames); return(Initialize(provider, assemblies, exAssemblies, exceptTypes)); }
/// <summary> /// 初始化PortalService /// </summary> public static bool Initialize(IPortalServiceProvider provider, Assembly[] assemblies, Assembly[] exAssemblies, params Type[] exceptTypes) { if (Instance.isInitialized) { throw new Exception("PortalService已初始化"); } // 初始化Entity EntityManager.InitializeEntity(assemblies, exAssemblies, exceptTypes); Instance.isInitialized = true; // 设置Portal入口服务提供者 Instance._provider = provider; // 初始化服务上下文 Instance.systemContext = new SystemContext(); // 初始化化用户上下文列表 Instance.userContextList = new Dictionary <string, UserContext>(); // 刷新模块 RefreshSysModules(); return(Instance.isInitialized); }
/// <summary> /// 获取默认PortalService提供者 /// </summary> /// <returns></returns> public static IPortalServiceProvider GetDefaultProvider() { string typeName = ConfigurationHosting.SystemConfiguration.AppSettings[PortalServiceProviderKey]; IPortalServiceProvider psp = (IPortalServiceProvider)Activator.CreateInstance(Type.GetType(typeName)); return(psp); }
/// <summary> /// 初始化PortalService /// </summary> public static bool Initialize(IPortalServiceProvider provider) { if (Instance.isInitialized) { throw new Exception("PortalService已初始化"); } else { Instance.isInitialized = true; Instance._provider = provider; } return(Instance.isInitialized); }
/// <summary> /// 初始化PortalService /// </summary> /// <param name="provider"></param> /// <returns></returns> public static bool Initialize(IPortalServiceProvider provider) { return(Initialize(provider, null)); }
/// <summary> /// 初始化PortalService /// </summary> public static bool Initialize(Assembly[] assemblies, Assembly[] exAssemblies, params Type[] exceptTypes) { IPortalServiceProvider provider = GetDefaultProvider(); return(Initialize(provider, assemblies, exAssemblies, exceptTypes)); }
/// <summary> /// 初始化PortalService /// </summary> /// <param name="provider"></param> /// <returns></returns> public static bool Initialize() { IPortalServiceProvider provider = GetDefaultProvider(); return(Initialize(provider, null)); }