Exemplo n.º 1
0
 public ForumController(
     IForumCategoryService categoryService,
     IForumThreadService threadService)
 {
     this.categoryService = categoryService;
     this.threadService   = threadService;
 }
Exemplo n.º 2
0
 public AdminMenu(
     IForumsHomePageService forumForumsHomePageService,
     IForumCategoryService forumCategoryService,
     IForumService forumService
 ) {
     _forumForumsHomePageService = forumForumsHomePageService;
     _forumCategoryService = forumCategoryService;
     _forumService = forumService;                        
 }
 public ForumThreadService(
     IDeletableEntityRepository <ForumThread> threadRepository,
     IDeletableEntityRepository <ForumReply> replyRepository,
     IForumCategoryService categoryService,
     UserManager <ApplicationUser> userManager)
 {
     this.userManager      = userManager;
     this.threadRepository = threadRepository;
     this.replyRepository  = replyRepository;
     this.categoryService  = categoryService;
 }
 public ForumThreadController(
     IForumThreadService threadService,
     IForumCategoryService categoryService,
     IForumReplyService replyService,
     UserManager <ApplicationUser> userManager)
 {
     this.threadService   = threadService;
     this.categoryService = categoryService;
     this.replyService    = replyService;
     this.userManager     = userManager;
 }
        /// <summary>重新加载</summary>
        private void Reload()
        {
            if (this.restartCount > 0)
            {
                // 重新加载配置信息
                ForumConfigurationView.Instance.Reload();
            }

            // 创建对象构建器(Spring.NET)
            string springObjectFile = ForumConfigurationView.Instance.Configuration.Keys["SpringObjectFile"].Value;

            SpringObjectBuilder objectBuilder = SpringObjectBuilder.Create(ForumConfiguration.ApplicationName, springObjectFile);

            // 创建数据服务对象
            this.m_ForumCategoryService = objectBuilder.GetObject <IForumCategoryService>(typeof(IForumCategoryService));
            this.m_ForumThreadService   = objectBuilder.GetObject <IForumThreadService>(typeof(IForumThreadService));
            this.m_ForumCommentService  = objectBuilder.GetObject <IForumCommentService>(typeof(IForumCommentService));
            this.m_ForumMemberService   = objectBuilder.GetObject <IForumMemberService>(typeof(IForumMemberService));
            this.m_ForumFollowService   = objectBuilder.GetObject <IForumFollowService>(typeof(IForumFollowService));
        }
Exemplo n.º 6
0
        public ForumsHomePageController(
            IOrchardServices orchardServices, 
            IForumCategoryService forumCategoryService,
            IForumService forumService,
            IThreadService threadService,
            ISiteService siteService,
            IShapeFactory shapeFactory,
            IThreadLastReadService threadLastReadService

         ) {
            _orchardServices = orchardServices;
            _forumService = forumService;
            _threadService = threadService;
            _siteService = siteService;
            _threadLastReadService = threadLastReadService;
            _forumCategoryService = forumCategoryService;

            Shape = shapeFactory;
            Logger = NullLogger.Instance;
            T = NullLocalizer.Instance;
        }
Exemplo n.º 7
0
        public ForumCategoryPartHandler(
            IRepository<ForumCategoryPartRecord> repository,
            IForumCategoryService forumCategoryService,
            IForumService forumService,
            IOrchardServices orchardServices
        )
        {
            _forumCategoryService = forumCategoryService;
            _forumService = forumService;
            _orchardServices = orchardServices;
            Filters.Add(StorageFilter.For(repository));

            OnPublished<ForumCategoryPart>((context, part) =>
            {
                VerifyUrlLength(part);
            });

            OnRemoving<ForumCategoryPart>((context, part) =>
            {
                //   foreach(var response in contentManager.Query<CommentPart, CommentPartRecord>().Where(x => x.RepliedOn == comment.Id).List()) {
                //       contentManager.Remove(response.ContentItem);
                //  }
            });

            OnUpdating<ForumCategoryPart>((context, part) =>
            {
                int i = 0;
                i = i + 1;
            });


            OnUpdated<ForumCategoryPart>((context, part) =>
            {
                int i = 0;
                i = i + 1;
                //part.Forums = _forumCategoryService.GetForumsForCategory(part, VersionOptions.AllVersions).ToList();
            });

        }