當前位置: 首頁>>代碼示例>>C#>>正文


C# TableItemStyle.AddAttributesToRender方法代碼示例

本文整理匯總了C#中System.Web.UI.WebControls.TableItemStyle.AddAttributesToRender方法的典型用法代碼示例。如果您正苦於以下問題:C# TableItemStyle.AddAttributesToRender方法的具體用法?C# TableItemStyle.AddAttributesToRender怎麽用?C# TableItemStyle.AddAttributesToRender使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Web.UI.WebControls.TableItemStyle的用法示例。


在下文中一共展示了TableItemStyle.AddAttributesToRender方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RenderCalendarHeaderCell

 private void RenderCalendarHeaderCell(HtmlTextWriter writer, TableItemStyle style, string text, string abbrText)
 {
     style.AddAttributesToRender(writer, this);
     writer.AddAttribute("abbr", abbrText);
     writer.AddAttribute("scope", "col");
     writer.RenderBeginTag(HtmlTextWriterTag.Th);
     writer.Write(text);
     writer.RenderEndTag();
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:9,代碼來源:Calendar.cs

示例2: AddAttributesToRender_Null_WebControl

		public void AddAttributesToRender_Null_WebControl ()
		{
			TableItemStyle tis = new TableItemStyle ();
			tis.AddAttributesToRender (null, new TableRow ());
			// no exception
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:6,代碼來源:TableItemStyleTest.cs

示例3: RenderCalendarCell

 private void RenderCalendarCell(HtmlTextWriter writer, TableItemStyle style, string text, string title, bool hasButton, string eventArgument)
 {
     style.AddAttributesToRender(writer, this);
     writer.RenderBeginTag(HtmlTextWriterTag.Td);
     if (hasButton)
     {
         Color foreColor = style.ForeColor;
         writer.Write("<a href=\"");
         writer.Write(this.Page.ClientScript.GetPostBackClientHyperlink(this, eventArgument, true));
         writer.Write("\" style=\"color:");
         writer.Write(foreColor.IsEmpty ? this.defaultButtonColorText : ColorTranslator.ToHtml(foreColor));
         if (!string.IsNullOrEmpty(title))
         {
             writer.Write("\" title=\"");
             writer.Write(title);
         }
         writer.Write("\">");
         writer.Write(text);
         writer.Write("</a>");
     }
     else
     {
         writer.Write(text);
     }
     writer.RenderEndTag();
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:26,代碼來源:Calendar.cs

示例4: RenderCalendarCell

        private void RenderCalendarCell(HtmlTextWriter writer, TableItemStyle style, string text, string title, bool hasButton, string eventArgument) {
            style.AddAttributesToRender(writer, this);
            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            if (hasButton) {

                // render the button
                Color foreColor = style.ForeColor;
                writer.Write("<a href=\"");
                writer.Write(Page.ClientScript.GetPostBackClientHyperlink(this, eventArgument, true));

                // ForeColor needs to go on the actual link. This breaks the uplevel/downlevel rules a little bit,
                // but it is worth doing so the day links do not change color when they go in the history on
                // downlevel browsers. Otherwise, people get it confused with the selection mechanism.
                writer.Write("\" style=\"color:");
                writer.Write(foreColor.IsEmpty ? defaultButtonColorText : ColorTranslator.ToHtml(foreColor));

                if (!String.IsNullOrEmpty(title)) {
                    writer.Write("\" title=\"");
                    writer.Write(title);
                }

                writer.Write("\">");
                writer.Write(text);
                writer.Write("</a>");
            }
            else {
                writer.Write(text);
            }

            writer.RenderEndTag();
        }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:32,代碼來源:Calendar.cs


注:本文中的System.Web.UI.WebControls.TableItemStyle.AddAttributesToRender方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。