ScrewTurn.Wiki.DefaultPage.SetupPageContent C# (CSharp) Method

SetupPageContent() private method

Sets the actual page content, based on the current view mode (normal, discussion, view code).
private SetupPageContent ( bool canPostMessages, bool canManageDiscussion ) : void
canPostMessages bool A value indicating whether the current user can post messages.
canManageDiscussion bool A value indicating whether the current user can manage the discussion.
return void
        private void SetupPageContent(bool canPostMessages, bool canManageDiscussion)
        {
            if(!discussMode && !viewCodeMode) {
                Literal literal = new Literal();
                literal.Text = Content.GetFormattedPageContent(currentPage, true);
                plhContent.Controls.Add(literal);
            }
            else if(!discussMode && viewCodeMode) {
                if(Settings.EnableViewPageCodeFeature) {
                    Literal literal = new Literal();
                    StringBuilder sb = new StringBuilder(currentContent.Content.Length + 100);
                    sb.Append(@"<textarea style=""width: 98%; height: 500px;"" readonly=""true"">");
                    sb.Append(Server.HtmlEncode(currentContent.Content));
                    sb.Append("</textarea>");
                    sb.Append("<br /><br />");
                    sb.Append(Properties.Messages.MetaKeywords);
                    sb.Append(": <b>");
                    sb.Append(PrintKeywords(currentContent.Keywords));
                    sb.Append("</b><br />");
                    sb.Append(Properties.Messages.MetaDescription);
                    sb.Append(": <b>");
                    sb.Append(currentContent.Description);
                    sb.Append("</b><br />");
                    sb.Append(Properties.Messages.ChangeComment);
                    sb.Append(": <b>");
                    sb.Append(currentContent.Comment);
                    sb.Append("</b>");
                    literal.Text = sb.ToString();
                    plhContent.Controls.Add(literal);
                }
            }
            else if(discussMode && !viewCodeMode) {
                PageDiscussion discussion = LoadControl("~/PageDiscussion.ascx") as PageDiscussion;
                discussion.CurrentPage = currentPage;
                discussion.CanPostMessages = canPostMessages;
                discussion.CanManageDiscussion = canManageDiscussion;
                plhContent.Controls.Add(discussion);
            }
        }