/// <summary> /// 应用初始化 /// </summary> /// <param name="containerBuilder">容器构建器</param> public override void Initialize(ContainerBuilder containerBuilder) { //注册ResourceAccessor的应用资源 ResourceAccessor.RegisterApplicationResourceManager(ApplicationId, "Spacebuilder.Ask.Resources.Resource", typeof(Spacebuilder.Ask.Resources.Resource).Assembly); //评论设置的注册 TenantCommentSettings.RegisterSettings(tenantCommentSettingsElement); //注册附件设置 TenantAttachmentSettings.RegisterSettings(tenantAttachmentSettingsElement); //注册问答正文解析器 containerBuilder.Register(c => new AskBodyProcessor()).Named <IBodyProcessor>(TenantTypeIds.Instance().Ask()).SingleInstance(); //注册全文检索搜索器 containerBuilder.Register(c => new AskSearcher("问答", "~/App_Data/IndexFiles/Ask", true, 8)).As <ISearcher>().Named <ISearcher>(AskSearcher.CODE).SingleInstance(); //问题应用数据统计 containerBuilder.Register(c => new AskQuestionApplicationStatisticDataGetter()).Named <IApplicationStatisticDataGetter>(this.ApplicationKey).SingleInstance(); //注册问题解析器 containerBuilder.Register(c => new AskBodyProcessor()).Named <IBodyProcessor>(TenantTypeIds.Instance().AskQuestion()).SingleInstance(); //注册回答解析器 containerBuilder.Register(c => new AskBodyProcessor()).Named <IBodyProcessor>(TenantTypeIds.Instance().AskAnswer()).SingleInstance(); //注册动态接收人获取器 containerBuilder.Register(c => new SubscribeQuestionActivityReceiverGetter()).Named <IActivityReceiverGetter>(ActivityOwnerTypes.Instance().AskQuestion().ToString()).SingleInstance(); containerBuilder.Register(c => new SubscribeTagActivityReceiverGetter()).Named <IActivityReceiverGetter>(ActivityOwnerTypes.Instance().AskTag().ToString()).SingleInstance(); }
/// <summary> /// 应用初始化 /// </summary> /// <param name="containerBuilder">容器构建器</param> public override void Initialize(ContainerBuilder containerBuilder) { //注册ResourceAccessor的应用资源 ResourceAccessor.RegisterApplicationResourceManager(ApplicationId, "Spacebuilder.Blog.Resources.Resource", typeof(Spacebuilder.Blog.Resources.Resource).Assembly); //注册附件设置 TenantAttachmentSettings.RegisterSettings(tenantAttachmentSettingsElement); TenantCommentSettings.RegisterSettings(tenantCommentSettingsElement); //注册日志站点设置 containerBuilder.Register(c => new BlogSettingsManager()).As <IBlogSettingsManager>().SingleInstance(); //注册日志正文解析器 containerBuilder.Register(c => new BlogBodyProcessor()).Named <IBodyProcessor>(TenantTypeIds.Instance().Blog()).SingleInstance(); //注册EventModule containerBuilder.Register(c => new BlogThreadEventModule()).As <IEventMoudle>().SingleInstance(); containerBuilder.Register(c => new BlogIndexEventModule()).As <IEventMoudle>().SingleInstance(); containerBuilder.Register(c => new BlogOperationLogEventModule()).As <IEventMoudle>().SingleInstance(); containerBuilder.Register(c => new BlogActivityReceiverGetter()).Named <IActivityReceiverGetter>(ActivityOwnerTypes.Instance().Blog().ToString()).SingleInstance(); //注册全文检索搜索器 containerBuilder.Register(c => new BlogSearcher("日志", "~/App_Data/IndexFiles/Blog", true, 3)).As <ISearcher>().Named <ISearcher>(BlogSearcher.CODE).SingleInstance(); //日志应用数据统计 containerBuilder.Register(c => new BlogApplicationStatisticDataGetter()).Named <IApplicationStatisticDataGetter>(this.ApplicationKey).SingleInstance(); containerBuilder.Register(c => new BlogCommentUrlGetter()).As <ICommentUrlGetter>().SingleInstance(); containerBuilder.Register(c => new BlogRecommendUrlGetter()).As <IRecommendUrlGetter>().SingleInstance(); containerBuilder.Register(c => new BlogOwnerDataGetter()).As <IOwnerDataGetter>().SingleInstance(); containerBuilder.Register(c => new BlogAtUserAssociatedUrlGetter()).As <IAtUserAssociatedUrlGetter>().SingleInstance(); }
/// <summary> /// 应用初始化 /// </summary> /// <param name="containerBuilder">容器构建器</param> public override void Initialize(ContainerBuilder containerBuilder) { //注册ResourceAccessor的应用资源 ResourceAccessor.RegisterApplicationResourceManager(ApplicationId, "Spacebuilder.Photo.Resources.Resource", typeof(Spacebuilder.Photo.Resources.Resource).Assembly); //评论设置的注册 TenantCommentSettings.RegisterSettings(tenantCommentSettingsElement); //注册附件设置 TenantAttachmentSettings.RegisterSettings(tenantAttachmentSettingsElement); //注册全文检索搜索器 containerBuilder.Register(c => new PhotoSearcher("相册", "~/App_Data/IndexFiles/Photo", true, 5)).As <ISearcher>().Named <ISearcher>(PhotoSearcher.CODE).SingleInstance(); //问题应用数据统计 containerBuilder.Register(c => new PhotoApplicationStatisticDataGetter()).Named <IApplicationStatisticDataGetter>(this.ApplicationKey).SingleInstance(); }
/// <summary> /// 应用初始化 /// </summary> /// <param name="containerBuilder">容器构建器</param> public override void Initialize(ContainerBuilder containerBuilder) { //注册ResourceAccessor的应用资源 ResourceAccessor.RegisterApplicationResourceManager(ApplicationId, "Spacebuilder.CMS.Resources.Resource", typeof(Spacebuilder.CMS.Resources.Resource).Assembly); //注册EventModule containerBuilder.RegisterAssemblyTypes(Assembly.Load("Spacebuilder.CMS")).Where(t => typeof(IEventMoudle).IsAssignableFrom(t)).As <IEventMoudle>().SingleInstance(); //注册全文检索搜索器 containerBuilder.Register(c => new CmsSearcher("资讯", "~/App_Data/IndexFiles/Cms", true, 4)).As <ISearcher>().Named <ISearcher>(CmsSearcher.CODE).SingleInstance(); //资讯应用数据统计 containerBuilder.Register(c => new CmsApplicationStatisticDataGetter()).Named <IApplicationStatisticDataGetter>(this.ApplicationKey).SingleInstance(); //注册资讯解析器 containerBuilder.Register(c => new CmsBodyProcessor()).Named <IBodyProcessor>(TenantTypeIds.Instance().ContentItem()).SingleInstance(); //注册附件设置 TenantAttachmentSettings.RegisterSettings(tenantAttachmentSettingsElement); //评论设置的注册 TenantCommentSettings.RegisterSettings(tenantCommentSettingsElement); }