//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)); }
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)); }