Exemple #1
0
        public HElement(HName name, params object[] content)
        {
            this.Name = name;

            var attributes = new List <HAttribute>();
            var nodes      = new List <HObject>();

            foreach (var node in HObject.HObjects(content))
            {
                if (node is HAttribute)
                {
                    attributes.Add(node as HAttribute);
                }
                else
                {
                    nodes.Add(node);
                }
            }
            this.Attributes = attributes.ToArray();
            this.Nodes      = nodes.ToArray();
        }
Exemple #2
0
 public static HElement Element(this HBuilder h, HName name, params object[] content)
 {
     return(new HElement(name, content));
 }
Exemple #3
0
 public static HAttribute Attribute(this HBuilder h, HName name, object value)
 {
     return(new HAttribute(name, value));
 }
Exemple #4
0
 public HAttribute(HName name, object value)
 {
     this.Name  = name;
     this.Value = value;
 }
Exemple #5
0
 public HElement Element(HName name)
 {
     return(Elements(name).FirstOrDefault());
 }
Exemple #6
0
 public IEnumerable <HElement> Elements(HName name)
 {
     return(Elements().Where(element => element.Name.LocalName == name.LocalName && element.Name.Namespace == name.Namespace));
 }