AoMBrgEditor.PssgNode.HasAttribute C# (CSharp) Метод

HasAttribute() публичный Метод

public HasAttribute ( string attributeName ) : bool
attributeName string
Результат bool
        public bool HasAttribute(string attributeName)
        {
            return attributes.ContainsKey(attributeName);
        }

Same methods

PssgNode::HasAttribute ( int attributeID ) : bool

Usage Example

Пример #1
0
 public PssgAttribute AddAttribute(PssgNode parentNode, int attributeID, object data)
 {
     if (parentNode == null)
     {
         return null;
     }
     if (parentNode.attributes == null)
     {
         parentNode.attributes = new Dictionary<string, PssgAttribute>();
     }
     else if (parentNode.HasAttribute(attributeID))
     {
         parentNode[attributeID].data = data;
         return parentNode[attributeID];
     }
     else if (parentNode.attributes.ContainsKey(attributeInfo[attributeID - 1].name))
     {
         return null;
     }
     PssgAttribute newAttr = new PssgAttribute(attributeID, data, this, parentNode);
     parentNode.attributes.Add(newAttr.Name, newAttr);
     return newAttr;
 }