private String GetAttributeName(HtmlTextWriterAttribute key) { String name = key.ToString().ToLower(); if (name.Contains(".")) { name = name.Substring(name.LastIndexOf(".") + 1); } return(name); }
public override void AddAttribute(HtmlTextWriterAttribute key, string value) { if (((key == HtmlTextWriterAttribute.Src) || (key == HtmlTextWriterAttribute.Href)) || (key == HtmlTextWriterAttribute.Background)) { base.AddAttribute(key.ToString(), value, key); } else { base.AddAttribute(key, value); } }
public static string AsText(this HtmlTextWriterAttribute attrib) { return(attrib.ToString().ToLower()); //switch (attrib) //{ // case HtmlTextWriterAttribute.Class: return "class"; // case HtmlTextWriterAttribute.Href: return "href"; // case HtmlTextWriterAttribute.Id: return "id"; // case HtmlTextWriterAttribute.Name: return "name"; // case HtmlTextWriterAttribute.Rel: return "rel"; // case HtmlTextWriterAttribute.Src: return "src"; // case HtmlTextWriterAttribute.Type: return "type"; // default: throw new NotSupportedException("Unsupported HtmlTextWriterAttribute. Use a string instead"); //} }
/// <summary> /// Initializes a new instance of the HtmlAttribute class. /// </summary> /// <param name="attribute">The attribute.</param> /// <param name="value">The value of the attribute.</param> public HtmlAttribute(HtmlTextWriterAttribute attribute, string value) { this.Name = attribute.ToString().ToLower(); this.Value = value; }
private String GetAttributeName(HtmlTextWriterAttribute key) { String name = key.ToString().ToLower(); if (name.Contains(".")) name = name.Substring(name.LastIndexOf(".") + 1); return name; }
public override void AddAttribute(HtmlTextWriterAttribute key, string value, bool fEncode) { AddAttributeCommand(key.ToString().ToLower(), new AddAttributeKeyStringBoolean(key, value, fEncode)); }
public static string Attribute([NotNull] this IAttributeAccessor thisValue, HtmlTextWriterAttribute attribute) { return(Attribute <string>(thisValue, attribute.ToString())); }
public static bool Attribute([NotNull] this IAttributeAccessor thisValue, HtmlTextWriterAttribute attribute, string value) { return(Attribute(thisValue, attribute.ToString(), value)); }
public static T Attribute <T>([NotNull] this IAttributeAccessor thisValue, HtmlTextWriterAttribute attribute, T defaultValue) { return(Attribute(thisValue, attribute.ToString(), defaultValue)); }
public static string Write(this HtmlTextWriterAttribute attr) { Enumeration.AssertDefined <HtmlTextWriterAttribute>(attr); return(attr.ToString().ToLowerInvariant()); }
public static ISgmlWriter Attribute(this ISgmlWriter writer, HtmlTextWriterAttribute name, object value) { writer.Attribute(name.ToString(), value); return writer; }