Пример #1
0
        /// <summary>
        /// Renders the contents of the <see cref="T:System.Web.UI.WebControls.Label" /> into the
        /// specified writer.
        /// </summary>
        /// <param name="writer">The output stream that renders HTML content to the client.</param>
        protected override void RenderContents(HtmlTextWriter writer)
        {
            using (UnitOfWork uof = new UnitOfWork())
            {
                var commentBo = new CommentBO(uof);

                int commentCount = commentBo.GetCommentCount(this.mParentIdValue);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, this.CssClass);
                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                if (commentCount > 0)
                {
                    //// writer.Write(String.Format(Me._text, commentCount))

                    if (this.mTextValue == null)
                    {
                        writer.Write(string.Format(Localization.GetString("FeedBack.Text", WikiModuleBase.SharedResources), commentCount));
                    }
                    else
                    {
                        writer.Write(string.Format(this.mTextValue, commentCount));
                    }
                }
                else
                {
                    writer.Write(Localization.GetString("NoComments.Text", WikiModuleBase.SharedResources));
                }

                writer.RenderEndTag();
            }
        }
Пример #2
0
        /// <summary>
        /// Renders the contents of the <see cref="T:System.Web.UI.WebControls.Label" /> into the
        /// specified writer.
        /// </summary>
        /// <param name="writer">The output stream that renders HTML content to the client.</param>
        protected override void RenderContents(HtmlTextWriter writer)
        {
            using (UnitOfWork uof = new UnitOfWork())
            {
                var commentBo = new CommentBO(uof);

                int commentCount = commentBo.GetCommentCount(this.mParentIdValue);
                writer.AddAttribute(HtmlTextWriterAttribute.Class, this.CssClass);
                writer.RenderBeginTag(HtmlTextWriterTag.Span);
                if (commentCount > 0)
                {
                    //// writer.Write(String.Format(Me._text, commentCount))

                    if (this.mTextValue == null)
                    {
                        writer.Write(string.Format(Localization.GetString("FeedBack.Text", WikiModuleBase.SharedResources), commentCount));
                    }
                    else
                    {
                        writer.Write(string.Format(this.mTextValue, commentCount));
                    }
                }
                else
                {
                    writer.Write(Localization.GetString("NoComments.Text", WikiModuleBase.SharedResources));
                }

                writer.RenderEndTag();
            }
        }