コード例 #1
0
        private String GetAttributeName(HtmlTextWriterAttribute key)
        {
            String name = key.ToString().ToLower();

            if (name.Contains("."))
            {
                name = name.Substring(name.LastIndexOf(".") + 1);
            }
            return(name);
        }
コード例 #2
0
 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 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);
     }
 }
コード例 #4
0
ファイル: Extensions.cs プロジェクト: simondixey/padarn
        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");
            //}
        }
コード例 #5
0
		/// <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;
		}
コード例 #6
0
ファイル: HtmlTextWriter.cs プロジェクト: jbunzel/MvcRQ_git
 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));
 }
コード例 #8
0
 public static string Attribute([NotNull] this IAttributeAccessor thisValue, HtmlTextWriterAttribute attribute)
 {
     return(Attribute <string>(thisValue, attribute.ToString()));
 }
コード例 #9
0
 public static bool Attribute([NotNull] this IAttributeAccessor thisValue, HtmlTextWriterAttribute attribute, string value)
 {
     return(Attribute(thisValue, attribute.ToString(), value));
 }
コード例 #10
0
 public static T Attribute <T>([NotNull] this IAttributeAccessor thisValue, HtmlTextWriterAttribute attribute, T defaultValue)
 {
     return(Attribute(thisValue, attribute.ToString(), defaultValue));
 }
コード例 #11
0
ファイル: Html.cs プロジェクト: amittal09/Utility
 public static string Write(this HtmlTextWriterAttribute attr)
 {
     Enumeration.AssertDefined <HtmlTextWriterAttribute>(attr);
     return(attr.ToString().ToLowerInvariant());
 }
コード例 #12
0
ファイル: Util.cs プロジェクト: rneuber1/InnovatorAdmin
 public static ISgmlWriter Attribute(this ISgmlWriter writer, HtmlTextWriterAttribute name, object value)
 {
   writer.Attribute(name.ToString(), value);
   return writer;
 }