/// <summary> /// Gets the value of an attribute with name. The name is queried with a case insensitive search /// </summary> /// <returns> /// The value of the attribute or null if the an attribute with that name was not found /// </returns> /// <param name='attributes'> /// Attribute collection to be traversed /// </param> /// <param name='key'> /// Name of the attribute. /// </param> public static string GetAttributeValueCI (XAttributeCollection attributes, string key) { XName nameKey = new XName (key.ToLowerInvariant ()); foreach (XAttribute attr in attributes) { if (attr.Name.ToLower () == nameKey) return attr.Value; } return String.Empty; }
/// <summary> /// Gets the XAttribute instance of an attribute. The name is queried with a case insensitive search /// </summary> /// <returns> /// The XAttribute instance of an attribute or null, if none was found. /// </returns> /// <param name='attributes'> /// Attribute collection. /// </param> /// <param name='key'> /// Name of the attribute. /// </param> public static XAttribute GetAttributeCI (XAttributeCollection attributes, string key) { XName nameKey = new XName (key.ToLowerInvariant ()); foreach (XAttribute attr in attributes) { if (attr.Name.ToLower () == nameKey) return attr; } return null; }
/// <summary> /// Gets the XAttribute instance of an attribute. The name is queried with a case insensitive search /// </summary> /// <returns> /// The XAttribute instance of an attribute or null, if none was found. /// </returns> /// <param name='attributes'> /// Attribute collection. /// </param> /// <param name='key'> /// Name of the attribute. /// </param> public static XAttribute GetAttributeCI(XAttributeCollection attributes, string key) { //XName nameKey = new XName (key.ToLowerInvariant ()); foreach (XAttribute attr in attributes) { if (IsXNameEqualCI(attr.Name, key)) { return(attr); } } return(null); }
string GetAttributeValueCI(XAttributeCollection attributes, string key) { XName nameKey = new XName(key.ToLowerInvariant()); foreach (XAttribute attr in attributes) { if (attr.Name.ToLower() == nameKey) { return(attr.Value); } } return(string.Empty); }
protected AspNetDirective() { attributes = new XAttributeCollection(this); }
public AspNetDirective(TextLocation start) : base(start) { attributes = new XAttributeCollection(this); }
public WebFormsDirective (TextLocation start) : base (start) { attributes = new XAttributeCollection (this); }
protected WebFormsDirective () { attributes = new XAttributeCollection (this); }
protected XElement () { attributes = new XAttributeCollection (this); }
string GetAttributeValueCI(XAttributeCollection attributes, string key) { return(attributes.GetValue(new XName(key), true) ?? string.Empty); }
public WebFormsDirective(DocumentLocation start) : base(start) { attributes = new XAttributeCollection(this); }
public XElement (DocumentLocation start) : base (start) { attributes = new XAttributeCollection (this); }
protected WebFormsDirective() { attributes = new XAttributeCollection(this); }
public static bool IsTrue(this XAttributeCollection attributes, string name) { var att = attributes.Get(new XName(name), true); return(att != null && string.Equals(att.Value, "true", StringComparison.OrdinalIgnoreCase)); }
string GetAttributeValueCI (XAttributeCollection attributes, string key) { return attributes.GetValue (new XName (key), true) ?? string.Empty; }
protected AspNetDirective () { attributes = new XAttributeCollection (this); }
public AspNetDirective (DomLocation start) : base (start) { attributes = new XAttributeCollection (this); }