Beispiel #1
0
        public ForumPartHandler(IWorkContextAccessor workContextAccessor,
                                IWaveNotificationWrapper waveNotificationWrapper)
        {
            _workContextAccessor     = workContextAccessor;
            _waveNotificationWrapper = waveNotificationWrapper;

            OnPublished <PostPart>((context, postPart) => {
                if (!postPart.IsParentThread())
                {
                    return;
                }

                var threadPart = postPart.ThreadPart;
                var forumPart  = threadPart.ForumPart;

                var workContext = _workContextAccessor.GetContext();
                var location    = new UrlHelper(workContext.HttpContext.Request.RequestContext).ThreadView(threadPart);

                _waveNotificationWrapper.NotifyThreadCreated(forumPart.Id, threadPart.Id, postPart.Id, location);
            });

            OnRemoved <ThreadPart>((context, threadPart) => {
                var forumPart = threadPart.ForumPart;

                _waveNotificationWrapper.NotifyThreadRemoved(forumPart.Id, threadPart.Id);
            });
        }
Beispiel #2
0
        public PostPartHandler(IWaveNotificationWrapper waveNotificationWrapper) {
            _waveNotificationWrapper = waveNotificationWrapper;

            OnRemoved<PostPart>((context, postPart) => {
                if (postPart.IsParentThread())
                    return;

                var threadPart = postPart.ThreadPart;
                var forumPart = threadPart.ForumPart;

                _waveNotificationWrapper.NotifyPostRemoved(forumPart.Id, threadPart.Id, postPart.Id);
            });
        }
Beispiel #3
0
        public PostPartHandler(IWaveNotificationWrapper waveNotificationWrapper)
        {
            _waveNotificationWrapper = waveNotificationWrapper;

            OnRemoved <PostPart>((context, postPart) => {
                if (postPart.IsParentThread())
                {
                    return;
                }

                var threadPart = postPart.ThreadPart;
                var forumPart  = threadPart.ForumPart;

                _waveNotificationWrapper.NotifyPostRemoved(forumPart.Id, threadPart.Id, postPart.Id);
            });
        }
        public ThreadPartHandler(IWorkContextAccessor workContextAccessor,
            IWaveNotificationWrapper waveNotificationWrapper) {
            _workContextAccessor = workContextAccessor;
            _waveNotificationWrapper = waveNotificationWrapper;

            OnPublished<PostPart>((context, postPart) => {
                if (postPart.IsParentThread())
                    return;

                var threadPart = postPart.ThreadPart;
                var forumPart = threadPart.ForumPart;

                var workContext = _workContextAccessor.GetContext();
                var location = new UrlHelper(workContext.HttpContext.Request.RequestContext).PostView(postPart);

                _waveNotificationWrapper.NotifyPostCreated(threadPart.Id, forumPart.Id, threadPart.Id, postPart.Id, postPart.RepliedOn.Value, location, postPart.Text);
                _waveNotificationWrapper.NotifyPostCreated(forumPart.Id, forumPart.Id, threadPart.Id, postPart.Id, postPart.RepliedOn.Value, location, postPart.Text);
            });
        }
Beispiel #5
0
        public ThreadPartHandler(IWorkContextAccessor workContextAccessor,
                                 IWaveNotificationWrapper waveNotificationWrapper)
        {
            _workContextAccessor     = workContextAccessor;
            _waveNotificationWrapper = waveNotificationWrapper;

            OnPublished <PostPart>((context, postPart) => {
                if (postPart.IsParentThread())
                {
                    return;
                }

                var threadPart = postPart.ThreadPart;
                var forumPart  = threadPart.ForumPart;

                var workContext = _workContextAccessor.GetContext();
                var location    = new UrlHelper(workContext.HttpContext.Request.RequestContext).PostView(postPart);

                _waveNotificationWrapper.NotifyPostCreated(threadPart.Id, forumPart.Id, threadPart.Id, postPart.Id, postPart.RepliedOn.Value, location, postPart.Text);
                _waveNotificationWrapper.NotifyPostCreated(forumPart.Id, forumPart.Id, threadPart.Id, postPart.Id, postPart.RepliedOn.Value, location, postPart.Text);
            });
        }
        public ForumPartHandler(IWorkContextAccessor workContextAccessor,
            IWaveNotificationWrapper waveNotificationWrapper) {
            _workContextAccessor = workContextAccessor;
            _waveNotificationWrapper = waveNotificationWrapper;

            OnPublished<PostPart>((context, postPart) => {
                if (!postPart.IsParentThread())
                    return;

                var threadPart = postPart.ThreadPart;
                var forumPart = threadPart.ForumPart;

                var workContext = _workContextAccessor.GetContext();
                var location = new UrlHelper(workContext.HttpContext.Request.RequestContext).ThreadView(threadPart);

                _waveNotificationWrapper.NotifyThreadCreated(forumPart.Id, threadPart.Id, postPart.Id, location);
            });

            OnRemoved<ThreadPart>((context, threadPart) => {
                var forumPart = threadPart.ForumPart;
                
                _waveNotificationWrapper.NotifyThreadRemoved(forumPart.Id, threadPart.Id);
            });
        }