Esempio n. 1
0
        protected void InitSubscribers(ActionContainer actionsContainer, Guid blogAutorID)
        {
            if (!SecurityContext.DemoMode && SecurityContext.IsAuthenticated)
            {
                Utility.RegisterTypeForAjax(typeof (Subscriber));
                _subscriber = new Subscriber();

                AddNewPostSubscriber(actionsContainer);

                if (this is Default && !String.IsNullOrEmpty(Request["userID"]))
                {
                    var userID = Guid.Empty;
                    try
                    {
                        userID = new Guid(Request["userID"]);

                    }
                    catch
                    {
                        userID = Guid.Empty;
                    }

                    if (!userID.Equals(Guid.Empty))
                        AddPersonalBlogSubscriber(userID, actionsContainer);
                }

                if (this is ViewBlog)
                {
                    if (!blogAutorID.Equals(Guid.Empty))
                        AddPersonalBlogSubscriber(blogAutorID, actionsContainer);


                    var blogID = Guid.Empty;
                    try
                    {
                        blogID = new Guid(Request["blogID"]);
                    }
                    catch
                    {
                        blogID = Guid.Empty;
                    }


                    if (!blogID.Equals(Guid.Empty))
                        AddCommentsSubscriber(blogID, actionsContainer);

                }
            }
        }
Esempio n. 2
0
 protected void InitSubscribers(ActionContainer actionsContainer)
 {
     InitSubscribers(actionsContainer, Guid.Empty);
 }
Esempio n. 3
0
        private void AddPersonalBlogSubscriber(Guid userID, ActionContainer actionsContainer)
        {

            var isSubscribe = _subscriber.IsPersonalBlogSubscribe(userID);
            var sb = new StringBuilder();
            sb.Append(_subscriber.RenderPersonalBlogSubscription(!isSubscribe, userID));

            actionsContainer.ActionsPlaceHolder.Controls.Add(new HtmlMenuItem(sb.ToString()));
        }
Esempio n. 4
0
        private void AddCommentsSubscriber(Guid blogID, ActionContainer actionsContainer)
        {
            var isSubscribe = _subscriber.IsCommentsSubscribe(blogID);
            var sb = new StringBuilder();
            sb.Append(_subscriber.RenderCommentsSubscription(!isSubscribe, blogID));

            actionsContainer.ActionsPlaceHolder.Controls.Add(new HtmlMenuItem(sb.ToString()));
        }
Esempio n. 5
0
        private void AddNewPostSubscriber(ActionContainer actionsContainer)
        {
            var isSubscribe = _subscriber.IsNewPostsSubscribe();
            var sb = new StringBuilder();
            sb.Append(_subscriber.RenderNewPostsSubscription(!isSubscribe));

            actionsContainer.ActionsPlaceHolder.Controls.Add(new HtmlMenuItem(sb.ToString()));
        }