Beispiel #1
0
        /// <inheritdoc />
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            if (string.IsNullOrEmpty(Xid))
            {
                throw new MissingRequiredAttribute("Xid", Xid);
            }

            writer.AddAttribute("xid", Xid);

            if (!CanPost)
            {
                writer.AddAttribute("canpost", FbmlConstants.FALSE);
            }
            if (CanDelete)
            {
                writer.AddAttribute("candelete", FbmlConstants.TRUE);
            }
            if (CanMark)
            {
                writer.AddAttribute("canmark", FbmlConstants.TRUE);
            }
            if (!CanCreateTopic)
            {
                writer.AddAttribute("cancreatetopic", FbmlConstants.FALSE);
            }
            if (NumTopics > 0)
            {
                writer.AddAttribute("numtopics", NumTopics.ToString());
            }


            if (!string.IsNullOrEmpty(CallbackUrl))
            {
                writer.AddAttribute("callbackurl", CallbackUrl);
            }
            if (!string.IsNullOrEmpty(ReturnUrl))
            {
                writer.AddAttribute("returnurl", ReturnUrl);
            }

            base.AddAttributesToRender(writer);
        }
Beispiel #2
0
        /// <inheritdoc />
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            if (string.IsNullOrEmpty(Xid))
            {
                throw new MissingRequiredAttribute("Xid", Xid);
            }

            writer.AddAttribute("xid", Xid);
            if (NumTopics > 0)
            {
                writer.AddAttribute("numtopics", NumTopics.ToString());
            }
            else
            {
                throw new MissingRequiredAttribute("NumTopics", NumTopics);
            }


            if (!CanPost)
            {
                writer.AddAttribute("canpost", FbmlConstants.FALSE);
            }
            else
            {
                writer.AddAttribute("canpost", FbmlConstants.TRUE);
            }
            if (!CanDelete)
            {
                writer.AddAttribute("candelete", FbmlConstants.FALSE);
            }
            else
            {
                writer.AddAttribute("candelete", FbmlConstants.TRUE);
            }


            if (!string.IsNullOrEmpty(CallbackUrl))
            {
                writer.AddAttribute("callbackurl", CallbackUrl);
            }
            if (!string.IsNullOrEmpty(ReturnUrl))
            {
                writer.AddAttribute("returnurl", ReturnUrl);
            }

            if (CanPost && !ShowForm)
            {
                writer.AddAttribute("showform", FbmlConstants.FALSE);
            }
            else if (CanPost)
            {
                writer.AddAttribute("showform", FbmlConstants.TRUE);
            }
            if (!PublishFeed)
            {
                writer.AddAttribute("publishfeed", FbmlConstants.FALSE);
            }
            else
            {
                writer.AddAttribute("publishfeed", FbmlConstants.TRUE);
            }
            if (!Simple)
            {
                writer.AddAttribute("simple", FbmlConstants.FALSE);
            }
            else
            {
                writer.AddAttribute("simple", FbmlConstants.TRUE);
            }
            if (!Reverse)
            {
                writer.AddAttribute("reverse", FbmlConstants.FALSE);
            }
            else
            {
                writer.AddAttribute("reverse", FbmlConstants.TRUE);
            }
            if (!Quiet)
            {
                writer.AddAttribute("quiet", FbmlConstants.FALSE);
            }
            else
            {
                writer.AddAttribute("quiet", FbmlConstants.TRUE);
            }

            base.AddAttributesToRender(writer);
        }