public static Dictionary <string, string> ToDictionary(this XAttributeCollection attributes, StringComparer comparer)
        {
            var dict = new Dictionary <string, string> (comparer);

            foreach (XAttribute a in attributes)
            {
                dict[a.Name.FullName] = a.Value ?? string.Empty;
            }
            return(dict);
        }
Esempio n. 2
0
 protected XElement()
 {
     attributes = new XAttributeCollection(this);
 }
Esempio n. 3
0
 public XElement(DocumentLocation start) : base(start)
 {
     attributes = new XAttributeCollection(this);
 }
        public static bool IsTrue(this XAttributeCollection attributes, string name)
        {
            var att = attributes.Get(name, true);

            return(att != null && string.Equals(att.Value, "true", StringComparison.OrdinalIgnoreCase));
        }
Esempio n. 5
0
 public XElement(int startOffset) : base(startOffset)
 {
     Attributes = new XAttributeCollection(this);
 }