Exemplo n.º 1
0
 //Warning: This function will throw an exception in case the attribute doesn't exist!
 public virtual string GetNodeAttribute(string attr, bool recursive = false)
 {
     if (!recursive || (Parent == null) || NodeAttributes.ContainsKey(attr))
     {
         return(NodeAttributes[attr]);
     }
     return(Parent.GetNodeAttribute(attr, true));
 }
Exemplo n.º 2
0
        public virtual bool HasNodeAttribute(string attr, bool recursive = false)
        {
            var hasLocalAttr = NodeAttributes.ContainsKey(attr);

            if (!recursive || hasLocalAttr || (Parent == null))
            {
                return(hasLocalAttr);
            }
            return(Parent.HasNodeAttribute(attr, true));
        }