示例#1
0
		/// <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;
		}
示例#2
0
		/// <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;
		}
示例#3
0
        /// <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);
		}
示例#9
0
		protected XElement ()
		{
			attributes = new XAttributeCollection (this);
		}
示例#10
0
 string GetAttributeValueCI(XAttributeCollection attributes, string key)
 {
     return(attributes.GetValue(new XName(key), true) ?? string.Empty);
 }
示例#11
0
 public WebFormsDirective(DocumentLocation start) : base(start)
 {
     attributes = new XAttributeCollection(this);
 }
示例#12
0
		public XElement (DocumentLocation start) : base (start)
		{
			attributes = new XAttributeCollection (this);
		}
示例#13
0
 protected WebFormsDirective()
 {
     attributes = new XAttributeCollection(this);
 }
示例#14
0
        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);
		}