当前位置: 首页>>代码示例>>C#>>正文


C# HtmlTextWriterTag.ToString方法代码示例

本文整理汇总了C#中HtmlTextWriterTag.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriterTag.ToString方法的具体用法?C# HtmlTextWriterTag.ToString怎么用?C# HtmlTextWriterTag.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HtmlTextWriterTag的用法示例。


在下文中一共展示了HtmlTextWriterTag.ToString方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InsertText

        /// <summary>
        /// Write text inside tags of type HtmlTextWriterTag
        /// </summary>
        /// <param name="html">HtmlTextWriter instance object</param>
        /// <param name="value">Input text / string</param>
        /// <param name="tag">Value of HtmlTextWriterTag enumaration</param>
        /// <returns>HtmlTextWriter reference</returns>
        public static HtmlTextWriter InsertText(this HtmlTextWriter html, string value, HtmlTextWriterTag tag)
        {
            CheckNullParam(html);

            html.WriteBeginTag(tag.ToString());
            html.Write(HtmlTextWriter.TagRightChar);
            html.Write(value);
            html.WriteEndTag(tag.ToString());

            return html;
        }
开发者ID:targitaj,项目名称:m3utonetpaleyerxml,代码行数:18,代码来源:HtmlTextWritterExtender.cs

示例2: BuildOneTag

        internal static string BuildOneTag(string virtualPath, HtmlTextWriterTag tag)
        {
            TagRenderMode tagRenderMode;

            var tagBuilder = new TagBuilder(tag.ToString().ToLower());

            var absolutePath = VirtualPathUtility.ToAbsolute(virtualPath);
            switch (tag)
            {
                case HtmlTextWriterTag.Script:
                    tagRenderMode = TagRenderMode.Normal;
                    tagBuilder.MergeAttribute("type", "text/javascript");
                    tagBuilder.MergeAttribute("src", absolutePath);
                    break;
                case HtmlTextWriterTag.Link:
                    tagRenderMode = TagRenderMode.SelfClosing;
                    tagBuilder.MergeAttribute("type", "text/css");
                    tagBuilder.MergeAttribute("media", "all"); //always ALL?
                    tagBuilder.MergeAttribute("rel", "stylesheet");
                    tagBuilder.MergeAttribute("href", absolutePath);
                    break;
                default:
                    throw new InvalidOperationException();
            }

            return tagBuilder.ToString(tagRenderMode);
        }
开发者ID:junalmeida,项目名称:dotnet35-weboptimizations,代码行数:27,代码来源:AssetManager.cs

示例3: HtmlTag

		/// <summary>
		/// Initializes a new instance of the HtmlTag class. Renders the opening tag of an HTML node, including any attributes.
		/// </summary>
		/// <param name="writer">
		/// The HTMLTextWriter.
		/// </param>
		/// <param name="tag">
		/// The type of HTML tag.
		/// </param>
		/// <param name="style">
		/// The style.
		/// </param>
		/// <param name="attributes">
		/// HTML attributes.
		/// </param>
		public HtmlTag(HtmlTextWriter writer, HtmlTextWriterTag tag, TagStyle style, params HtmlAttribute[] attributes)
		{
			this.writer = writer;
			this.attributes = attributes;
			this.tag = tag.ToString().ToLower();
			this.tagStyle = style;
			this.StartRender();
		}
开发者ID:sitecorerick,项目名称:constellation.html,代码行数:23,代码来源:HtmlTag.cs

示例4: GetTagName

		protected override string GetTagName (HtmlTextWriterTag tagKey)
		{
			if (tagKey == HtmlTextWriterTag.Unknown ||
			    !Enum.IsDefined (typeof (HtmlTextWriterTag), tagKey))
				return "";

			return tagKey.ToString ().ToLower (CultureInfo.InvariantCulture);
			/* The code below is here just in case we need to split things up
			switch (tagkey) {
			case HtmlTextWriterTag.Unknown:
				return "";
			case HtmlTextWriterTag.A:
				return "a";
			case HtmlTextWriterTag.Acronym:
				return "acronym";
			case HtmlTextWriterTag.Address:
				return "address";
			case HtmlTextWriterTag.Area:
				return "area";
			case HtmlTextWriterTag.B:
				return "b";
			case HtmlTextWriterTag.Base:
				return "base";
			case HtmlTextWriterTag.Basefont:
				return "basefont";
			case HtmlTextWriterTag.Bdo:
				return "bdo";
			case HtmlTextWriterTag.Bgsound:
				return "bgsound";
			case HtmlTextWriterTag.Big:
				return "big";
			case HtmlTextWriterTag.Blockquote:
				return "blockquote";
			case HtmlTextWriterTag.Body:
				return "body";
			case HtmlTextWriterTag.Br:
				return "br";
			case HtmlTextWriterTag.Button:
				return "button";
			case HtmlTextWriterTag.Caption:
				return "caption";
			case HtmlTextWriterTag.Center:
				return "center";
			case HtmlTextWriterTag.Cite:
				return "cite";
			case HtmlTextWriterTag.Code:
				return "code";
			case HtmlTextWriterTag.Col:
				return "col";
			case HtmlTextWriterTag.Colgroup:
				return "colgroup";
			case HtmlTextWriterTag.Dd:
				return "dd";
			case HtmlTextWriterTag.Del:
				return "del";
			case HtmlTextWriterTag.Dfn:
				return "dfn";
			case HtmlTextWriterTag.Dir:
				return "dir";
			case HtmlTextWriterTag.Div:
				return "table";
			case HtmlTextWriterTag.Dl:
				return "dl";
			case HtmlTextWriterTag.Dt:
				return "dt";
			case HtmlTextWriterTag.Em:
				return "em";
			case HtmlTextWriterTag.Embed:
				return "embed";
			case HtmlTextWriterTag.Fieldset:
				return "fieldset";
			case HtmlTextWriterTag.Font:
				return "font";
			case HtmlTextWriterTag.Form:
				return "form";
			case HtmlTextWriterTag.Frame:
				return "frame";
			case HtmlTextWriterTag.Frameset:
				return "frameset";
			case HtmlTextWriterTag.H1:
				return "h1";
			case HtmlTextWriterTag.H2:
				return "h2";
			case HtmlTextWriterTag.H3:
				return "h3";
			case HtmlTextWriterTag.H4:
				return "h4";
			case HtmlTextWriterTag.H5:
				return "h5";
			case HtmlTextWriterTag.H6:
				return "h6";
			case HtmlTextWriterTag.Head:
				return "head";
			case HtmlTextWriterTag.Hr:
				return "hr";
			case HtmlTextWriterTag.Html:
				return "html";
			case HtmlTextWriterTag.I:
				return "i";
			case HtmlTextWriterTag.Iframe:
//.........这里部分代码省略.........
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:101,代码来源:Html32TextWriter.cs

示例5: GetTagName

 private String GetTagName(HtmlTextWriterTag key)
 {
     String name = key.ToString().ToLower();
     if (name.Contains(".")) name = name.Substring(name.LastIndexOf(".") + 1);
     return name;
 }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:6,代码来源:HtmlTextWriter.cs

示例6: Tag

 public DomQueryBuilder Tag(HtmlTextWriterTag tag)
 {
     return Tag(tag.ToString().ToLowerInvariant());
 }
开发者ID:JonKruger,项目名称:MvcContrib,代码行数:4,代码来源:DomQueryBuilder.cs

示例7: Element

 public static ISgmlWriter Element(this ISgmlWriter writer, HtmlTextWriterTag name, object value)
 {
   writer.Element(name.ToString(), value);
   return writer;
 }
开发者ID:rneuber1,项目名称:InnovatorAdmin,代码行数:5,代码来源:Util.cs


注:本文中的HtmlTextWriterTag.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。