Пример #1
0
        protected override void Render(System.Web.UI.HtmlTextWriter output)
        {
            var searchLinkManager = new SearchLinkManager();
            int pages = Total / PageSize;

            if (Total % PageSize > 0)
            {
                pages = pages + 1;
            }

            if (pages > 1)
            {

                for (int i = 1; i <= pages; i++)
                {
                    output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Class, "searchPagination");

                    if (i != Page)
                    {
                        output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Href, searchLinkManager.GetPageLink(i));
                        output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.A);
                        output.WriteLine(i.ToString());
                        output.RenderEndTag();
                    }
                    else
                    {
                        output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Span);
                        output.WriteLine(i.ToString());
                        output.RenderEndTag();
                    }
                }
            }
        }
 protected override void RenderEditMode(System.Web.UI.HtmlTextWriter writer)
 {
     List<PackageType> packageTypes = PackageController.GetPackageTypes();
     ControlStyle.AddAttributesToRender(writer);
     writer.AddAttribute(HtmlTextWriterAttribute.Type, "text");
     writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID);
     writer.RenderBeginTag(HtmlTextWriterTag.Select);
     writer.AddAttribute(HtmlTextWriterAttribute.Value, Null.NullString);
     if (StringValue == Null.NullString)
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Selected, "selected");
     }
     writer.RenderBeginTag(HtmlTextWriterTag.Option);
     writer.Write("<" + Localization.Localization.GetString("Not_Specified", Localization.Localization.SharedResourceFile) + ">");
     writer.RenderEndTag();
     foreach (PackageType type in packageTypes)
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Value, type.Type);
         if (type.Type == StringValue)
         {
             writer.AddAttribute(HtmlTextWriterAttribute.Selected, "selected");
         }
         writer.RenderBeginTag(HtmlTextWriterTag.Option);
         writer.Write(type.Type);
         writer.RenderEndTag();
     }
     writer.RenderEndTag();
 }
Пример #3
0
 protected override void Render(System.Web.UI.HtmlTextWriter writer)
 {
     if (null == data)
     {
         return;
     }
     writer.RenderBeginTag(HtmlTextWriterTag.Div);
     writer.AddAttribute(HtmlTextWriterAttribute.Src, data.Url);
     writer.RenderBeginTag(HtmlTextWriterTag.Img);
     writer.RenderEndTag();
     base.Render(writer);
     writer.RenderEndTag();
 }
Пример #4
0
        /// <summary>
        /// Renders the specified writer.
        /// </summary>
        /// <param name="writer">The writer.</param>
        public override void Render( System.Web.UI.HtmlTextWriter writer )
        {
            if ( Person != null )
            {
                writer.AddAttribute( HtmlTextWriterAttribute.Class, "badge" );
                writer.AddAttribute( HtmlTextWriterAttribute.Title, GetToolTipText( Person ) );
                writer.RenderBeginTag( HtmlTextWriterTag.Div );

                writer.AddAttribute( HtmlTextWriterAttribute.Src, GetIconPath( Person ) );
                writer.RenderBeginTag( HtmlTextWriterTag.Img );
                writer.RenderEndTag();

                writer.RenderEndTag();
            }
        }
 protected override void RenderEditMode(System.Web.UI.HtmlTextWriter writer)
 {
     int length = Null.NullInteger;
     if ((CustomAttributes != null))
     {
         foreach (System.Attribute attribute in CustomAttributes)
         {
             if (attribute is MaxLengthAttribute)
             {
                 MaxLengthAttribute lengthAtt = (MaxLengthAttribute)attribute;
                 length = lengthAtt.Length;
                 break;
             }
         }
     }
     ControlStyle.AddAttributesToRender(writer);
     writer.AddAttribute(HtmlTextWriterAttribute.Type, "text");
     writer.AddAttribute(HtmlTextWriterAttribute.Value, StringValue);
     if (length > Null.NullInteger)
     {
         writer.AddAttribute(HtmlTextWriterAttribute.Maxlength, length.ToString());
     }
     writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID);
     writer.RenderBeginTag(HtmlTextWriterTag.Input);
     writer.RenderEndTag();
 }
Пример #6
0
 public override void RenderHeader(System.Web.UI.HtmlTextWriter writer)
 {
     writer.AddAttribute("src", ResolveUrl(ScriptUrl ?? ""));
     writer.AddAttribute("type", Type ?? "text/javascript");
     writer.RenderBeginTag("script");
     writer.RenderEndTag();
 }
Пример #7
0
 public override void RenderHeader(System.Web.UI.HtmlTextWriter writer)
 {
     writer.AddAttribute("rel", "stylesheet");
     writer.AddAttribute("href", ResolveUrl(CssUrl ?? ""));
     writer.AddAttribute("type", "text/css");
     writer.RenderBeginTag("link");
     writer.RenderEndTag();
 }
Пример #8
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            writer.AddAttribute("class", CssClass);
            writer.RenderBeginTag("div");

            base.Render(writer);

            writer.RenderEndTag();
        }
Пример #9
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            AddAttributesToRender(writer);
            writer.AddAttribute("class", String.Format("docking-{0}", DockingStyle.ToString().ToLowerInvariant()));
            writer.RenderBeginTag("div");

            base.Render(writer);

            writer.RenderEndTag();
        }
Пример #10
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            base.Render(writer);

            Writer = writer;
            WriteTitle("WSFederationAuthenticationModule Information");

            writer.RenderBeginTag(HtmlTextWriterTag.Dl);
            for (Int32 i = 0; i != controls.Length; ++i)
                RenderListEntry(names[i], controls[i]);
            writer.RenderEndTag();
        }
Пример #11
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            AddAttributesToRender(writer);

            writer.AddStyleAttribute("background-color", GetStatusBackColor());
            writer.AddStyleAttribute("color", GetStatusForeColor());

            writer.RenderBeginTag("span");

            writer.Write(status.ToString().ToLower());

            writer.RenderEndTag();
        }
Пример #12
0
 protected override void Render(System.Web.UI.HtmlTextWriter writer)
 {
     if (!this.DesignMode)
     {
         EFClientTools.ClientUtility.ClientInfo.cErrorCode = 8270;
         writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ID);
         writer.AddAttribute(HtmlTextWriterAttribute.Type, "text");
         writer.AddAttribute(HtmlTextWriterAttribute.Class, JQControl.NumberBox);
         writer.AddAttribute(JQProperty.DataOptions, this.DataOptions);
         writer.RenderBeginTag(HtmlTextWriterTag.Input);
         writer.RenderEndTag();
         EFClientTools.ClientUtility.ClientInfo.cErrorCode = 0;
     }
 }
Пример #13
0
 protected override void Render(System.Web.UI.HtmlTextWriter writer)
 {
     string strText = this.Text;
     int intLenCol = Convert.ToInt32(this.Width.Value);
     int intLenText = this.Text.Length;
     if (intLenText > intLenCol)
     {
         strText = strText.Substring(0, intLenCol) + "...";
         writer.AddAttribute("title", this.Text);
     }
     writer.AddAttribute("class", this.CssClass);
     writer.RenderBeginTag(HtmlTextWriterTag.Span);
     writer.Write(strText);
     writer.RenderEndTag();
 }
Пример #14
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            double sum = 0;

            for (int i = 0; i < values.Count; i++)
            {
                sum += values[i];
            }

            AddAttributesToRender(writer);
            writer.RenderBeginTag("table");
            writer.RenderBeginTag("tr");

            for (int i = 0; i < values.Count; i++)
            {
                writer.AddStyleAttribute("width", String.Format("{0}%", (int)Math.Round(values[i] / sum * 100)));

                writer.RenderBeginTag("td");
                writer.RenderEndTag();
            }

            writer.RenderEndTag();
            writer.RenderEndTag();
        }
Пример #15
0
 protected override void Render(System.Web.UI.HtmlTextWriter writer)
 {
     string text = Regex.Replace(LongText, @"\s+", " ");
     string compactText = text;
     if (MaxLength < 4 || text.Length <= MaxLength)
         writer.AddAttribute("title", PermanentToolTip);
     else
     {
         compactText = text.Substring(0, MaxLength - 3) + "...";
         writer.AddAttribute("title", text + (string.IsNullOrEmpty(PermanentToolTip) ? "" : " -> " + PermanentToolTip));
     }
     writer.AddAttribute("class", this.CssClass);
     writer.RenderBeginTag(HtmlTextWriterTag.Span);
     writer.Write(compactText);
     writer.RenderEndTag();
 }
Пример #16
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            if (IsInDesignMode)
            {
                writer.AddAttribute("class", "sig-zone");
                writer.AddAttribute("zone-name", ZoneName);
                writer.RenderBeginTag("div");
            }

            base.Render(writer);

            if (IsInDesignMode)
            {
                writer.Write("<div style=\"clear:both\"></div>");
                writer.RenderEndTag();
            }
        }
Пример #17
0
 protected override void writeHtml(System.Web.UI.HtmlTextWriter html)
 {
     switch(BrTag.ComplianceMode)
     {
         case ComplianceModes.Xhtml:
             html.Write("<br />");
             break;
         case ComplianceModes.Html5:
             html.Write("<br>");
             break;
         case ComplianceModes.AspNet:
         default:
             html.RenderBeginTag("br");
             html.RenderEndTag();
             break;
     }
 }
		internal override void RenderItem (System.Web.UI.HtmlTextWriter output, FileViewItem item) {
			output.AddStyleAttribute (HtmlTextWriterStyle.Margin, "1px");
			output.AddStyleAttribute (HtmlTextWriterStyle.Width, "70px");
            output.AddStyleAttribute(HtmlTextWriterStyle.Display, "inline-block");
            output.AddStyleAttribute(HtmlTextWriterStyle.VerticalAlign, "top");
			output.RenderBeginTag (HtmlTextWriterTag.Div);

			fileView.RenderItemBeginTag (output, item);

			output.AddStyleAttribute (HtmlTextWriterStyle.Width, "70px");
			output.AddAttribute (HtmlTextWriterAttribute.Cellpadding, "0");
			output.AddAttribute (HtmlTextWriterAttribute.Cellspacing, "0");
			output.AddAttribute (HtmlTextWriterAttribute.Border, "0");
			output.RenderBeginTag (HtmlTextWriterTag.Table);

			output.RenderBeginTag (HtmlTextWriterTag.Tr);
			output.AddStyleAttribute (HtmlTextWriterStyle.TextAlign, "center");
			output.AddStyleAttribute (HtmlTextWriterStyle.VerticalAlign, "middle");
			output.AddStyleAttribute (HtmlTextWriterStyle.Height, "41px");
			output.AddStyleAttribute (HtmlTextWriterStyle.BackgroundImage, item.LargeImage);
			output.AddStyleAttribute ("background-position", "center center");
			output.AddStyleAttribute ("background-repeat", "no-repeat");
			if (item.Hidden)
				fileView.Controller.HiddenItemStyle.AddAttributesToRender (output);
			output.RenderBeginTag (HtmlTextWriterTag.Td);
			output.RenderEndTag ();
			output.RenderEndTag ();

			output.RenderBeginTag (HtmlTextWriterTag.Tr);
			output.RenderBeginTag (HtmlTextWriterTag.Td);
			output.AddStyleAttribute (HtmlTextWriterStyle.Cursor, "default");
			output.AddStyleAttribute (HtmlTextWriterStyle.Width, "70px");
            output.AddStyleAttribute(HtmlTextWriterStyle.PaddingBottom, "2px");
			output.AddStyleAttribute (HtmlTextWriterStyle.Overflow, "hidden");
			output.AddStyleAttribute (HtmlTextWriterStyle.TextAlign, "center");
			output.AddAttribute (HtmlTextWriterAttribute.Id, item.ClientID + "_Name");
			output.RenderBeginTag (HtmlTextWriterTag.Div);
			RenderItemName (output, item);
			output.RenderEndTag ();
			output.RenderEndTag ();
			output.RenderEndTag ();

			output.RenderEndTag ();

			fileView.RenderItemEndTag (output);

			output.RenderEndTag ();
		}
Пример #19
0
 /// 
 protected override void Render(System.Web.UI.HtmlTextWriter writer)
 {
     base.AddAttributesToRender(writer);
     if(!string.IsNullOrEmpty(ForControl))
     {
         Control ctrl = Util.FindControlRecursive(Page, ForControl);
         if(ctrl == null)
         {
             writer.AddAttribute(HtmlTextWriterAttribute.For, ForControl);
         }
         else
         {
             writer.AddAttribute(HtmlTextWriterAttribute.For, ctrl.ClientID);
         }
     }
     writer.RenderBeginTag(HtmlTextWriterTag.Label);
     writer.Write(Text);
     writer.RenderEndTag();
 }
        protected override void RenderContents(System.Web.UI.HtmlTextWriter writer)
        {
            writer.AddAttribute(HtmlTextWriterAttribute.Id, "traceContainer");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            var linkToggle = new HtmlAnchor {HRef = "#", ID = "lnkToggleView", InnerText = "toggle"};
            linkToggle.RenderControl(writer);

            btnClear.RenderControl(writer);

            const string contentPlaceholder = @"<table id='traceTable'><td><b>Start</b></td><td><b>Duration</b></td><td><b>Query</b></td></table>";
            writer.Write(contentPlaceholder);

            writer.Write(GetTraceTemplate());
            writer.Write(GetTraceAsJson());
            writer.Write(GetToggleJavascript());

            writer.RenderEndTag();		// div

            base.RenderContents(writer);
        }
Пример #21
0
 protected override void Render(System.Web.UI.HtmlTextWriter writer)
 {
     if (error)
         lblError.RenderControl(writer);
     else
     {
         writer.RenderBeginTag(HtmlTextWriterTag.Div);
         btnExport.RenderControl(writer);
         btnImport.RenderControl(writer);
         writer.RenderEndTag();
         txtXml.RenderControl(writer);
         writer.RenderBeginTag(HtmlTextWriterTag.Div);
         btnCancel.RenderControl(writer);
         btnSave.RenderControl(writer);
         writer.RenderEndTag();
     }
 }
		public static void WriteFooter (System.Web.UI.HtmlTextWriter writer)
		{
			writer.AddAttribute ("class", "footer");
			writer.RenderBeginTag ("div");
			
			writer.Write (Catalog.GetString ("Gallery generated by") + " ");
			
			writer.AddAttribute ("href", "http://www.gnome.org/projects/f-spot");
			writer.RenderBeginTag ("a");
			writer.Write (String.Format ("{0} {1}", FSpot.Defines.PACKAGE, FSpot.Defines.VERSION));
			writer.RenderEndTag ();

			writer.RenderEndTag ();
		}
Пример #23
0
        ///
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            AddAttributesToRender(writer);
            writer.AddStyleAttribute(HtmlTextWriterStyle.TextAlign, "left");
            if(!AllowTextWrap) writer.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);

            Nodes.Render(this, writer);

            writer.RenderEndTag();
        }
		public static void WritePageNav (System.Web.UI.HtmlTextWriter writer, string id, string url, string name)
		{
			writer.AddAttribute ("id", id);
			writer.RenderBeginTag ("div");				
			 
			writer.AddAttribute ("href", url);
			writer.RenderBeginTag ("a");
			writer.Write (name);
			writer.RenderEndTag ();
			
			writer.RenderEndTag ();
		}
		public void WriteHeader (System.Web.UI.HtmlTextWriter writer)
		{
			writer.RenderBeginTag ("head");
			/* It seems HtmlTextWriter always uses UTF-8, unless told otherwise */
			writer.Write ("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />");
			writer.WriteLine ();
			writer.RenderBeginTag ("title");
			writer.Write (gallery_name);
			writer.RenderEndTag ();

			writer.Write ("<link type=\"text/css\" rel=\"stylesheet\" href=\"");
			writer.Write (String.Format ("{0}", "style/" + stylesheet));
			writer.Write ("\" title=\"" + dark + "\" media=\"screen\" />" + Environment.NewLine);

			writer.Write ("<link type=\"text/css\" rel=\"prefetch ") ;
			writer.Write ("alternate stylesheet\" href=\"");
			writer.Write (String.Format ("{0}", "style/" + altstylesheet));
			writer.Write ("\" title=\"" + light + "\" media=\"screen\" />" + Environment.NewLine);

			writer.Write ("<script src=\"script/" + javascript + "\"");
			writer.Write (" type=\"text/javascript\"></script>" + Environment.NewLine);

			writer.RenderEndTag ();
		}
Пример #26
0
 protected override void RenderViewMode(System.Web.UI.HtmlTextWriter writer)
 {
     string propValue = this.Page.Server.HtmlDecode(Convert.ToString(this.Value));
     ControlStyle.AddAttributesToRender(writer);
     writer.RenderBeginTag(HtmlTextWriterTag.Span);
     writer.Write(propValue);
     writer.RenderEndTag();
 }
Пример #27
0
        /// <summary>
        /// Generates the target-specific inner markup for the Web control to which the control adapter is attached.
        /// </summary>
        /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> containing methods to render the target-specific output.</param>
        protected override void RenderContents( System.Web.UI.HtmlTextWriter writer )
        {
            RadioButton rb = Control as RadioButton;
            if ( rb != null )
            {
                writer.WriteLine();

                // always render the label tag for the radiobutton, even if the radiobutton doesn't have text
                bool renderRadioButtonLabel = true;
                if ( renderRadioButtonLabel )
                {
                    if ( rb is RockRadioButton )
                    {
                        if ( ( rb as RockRadioButton ).DisplayInline )
                        {
                            writer.AddAttribute( HtmlTextWriterAttribute.Class, "radio-inline" );
                        }
                    }

                    writer.RenderBeginTag( HtmlTextWriterTag.Label );
                }

                writer.AddAttribute( HtmlTextWriterAttribute.Id, rb.ClientID );
                writer.AddAttribute( HtmlTextWriterAttribute.Type, "radio" );

                string uniqueGroupName = rb.GetType().GetProperty( "UniqueGroupName", BindingFlags.Instance | BindingFlags.NonPublic ).GetValue( rb, null ) as string;
                writer.AddAttribute( HtmlTextWriterAttribute.Name, uniqueGroupName );

                writer.AddAttribute( HtmlTextWriterAttribute.Value, rb.ID );

                if ( !string.IsNullOrWhiteSpace( rb.CssClass ) )
                {
                    writer.AddAttribute( HtmlTextWriterAttribute.Class, rb.CssClass );
                }

                if ( rb.Checked )
                {
                    writer.AddAttribute( "checked", "checked" );
                }

                foreach ( var attributeKey in rb.Attributes.Keys )
                {
                    var key = attributeKey as string;
                    writer.AddAttribute( key, rb.Attributes[key] );
                }

                foreach ( var inputAttributeKey in rb.InputAttributes.Keys )
                {
                    var key = inputAttributeKey as string;
                    writer.AddAttribute( key, rb.InputAttributes[key] );
                }

                if ( rb.AutoPostBack )
                {
                    PostBackOptions postBackOption = new PostBackOptions( rb, string.Empty );
                    if ( rb.CausesValidation && this.Page.GetValidators( rb.ValidationGroup ).Count > 0 )
                    {
                        postBackOption.PerformValidation = true;
                        postBackOption.ValidationGroup = rb.ValidationGroup;
                    }
                    if ( this.Page.Form != null )
                    {
                        postBackOption.AutoPostBack = true;
                    }
                    writer.AddAttribute( HtmlTextWriterAttribute.Onclick, Page.ClientScript.GetPostBackEventReference( postBackOption, true ) );
                }

                writer.RenderBeginTag( HtmlTextWriterTag.Input );
                writer.RenderEndTag();

                if ( renderRadioButtonLabel )
                {
                    if ( rb.Text.Length > 0 )
                    {
                        writer.Write( rb.Text );
                    }
                    else
                    {
                        writer.Write( "&nbsp;" );
                    }

                    writer.RenderEndTag();      // Label
                }

                if ( Page != null && Page.ClientScript != null )
                {
                    Page.ClientScript.RegisterForEventValidation( uniqueGroupName, rb.ID );
                }
            }
        }
Пример #28
0
        void RenderOuterBorderBottomRow(System.Web.UI.HtmlTextWriter writer)
        {
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);

            if ((OuterBorderStyle & OuterBorderStyle.Left) > 0)
                RenderOuterBorderLeftBottomCorner(writer);
            RenderOuterBorderBottom(writer);
            if ((OuterBorderStyle & OuterBorderStyle.Right) > 0)
                RenderOuterBorderRightBottomCorner(writer);

            writer.RenderEndTag();
        }
Пример #29
0
 void RenderOuterBorderLeftBottomCorner(System.Web.UI.HtmlTextWriter writer)
 {
     writer.AddStyleAttribute("background-repeat", "no-repeat");
     writer.AddStyleAttribute("background-position", "bottom left");
     if (OuterBorderLeftBottomCornerImageUrl.Length > 0)
         writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundImage, "url(" + ResolveClientUrl(OuterBorderLeftBottomCornerImageUrl) + ")");
     if (!String.IsNullOrEmpty(ClientID))
         writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID + "_BorderLB");
     writer.RenderBeginTag(HtmlTextWriterTag.Td);
     //if (OuterBorderLeftBottomCornerImageUrl.Length > 0)
     //{
     //    writer.AddAttribute(HtmlTextWriterAttribute.Src, _urlResolver.ResolveClientUrl(OuterBorderLeftBottomCornerImageUrl));
     //    writer.AddAttribute(HtmlTextWriterAttribute.Alt, "");
     //    writer.RenderBeginTag(HtmlTextWriterTag.Img);
     //    writer.RenderEndTag();
     //}
     writer.RenderEndTag();
 }
Пример #30
0
 void RenderOuterBorderRight(System.Web.UI.HtmlTextWriter writer)
 {
     writer.AddStyleAttribute("background-repeat", "repeat-y");
     writer.AddStyleAttribute("background-position", "center right");
     if (OuterBorderRightWidth != Unit.Empty)
         writer.AddStyleAttribute(HtmlTextWriterStyle.Width, OuterBorderRightWidth.ToString());
     if (OuterBorderRightImageUrl.Length > 0)
         writer.AddStyleAttribute(HtmlTextWriterStyle.BackgroundImage, "url(" + ResolveClientUrl(OuterBorderRightImageUrl) + ")");
     if (!String.IsNullOrEmpty(ClientID))
         writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID + "_BorderR");
     writer.RenderBeginTag(HtmlTextWriterTag.Td);
     writer.RenderEndTag();
 }