private ValidatingReaderNodeData AddAttribute(int attIndex)
{
Debug.Assert(attIndex <= _attributeEvents.Length);
ValidatingReaderNodeData attInfo = _attributeEvents[attIndex];
if (attInfo != null)
{
attInfo.Clear(XmlNodeType.Attribute);
return attInfo;
}
if (attIndex >= _attributeEvents.Length - 1)
{ //reached capacity of array, Need to increase capacity to twice the initial
ValidatingReaderNodeData[] newAttributeEvents = new ValidatingReaderNodeData[_attributeEvents.Length * 2];
Array.Copy(_attributeEvents, 0, newAttributeEvents, 0, _attributeEvents.Length);
_attributeEvents = newAttributeEvents;
}
attInfo = _attributeEvents[attIndex];
if (attInfo == null)
{
attInfo = new ValidatingReaderNodeData(XmlNodeType.Attribute);
_attributeEvents[attIndex] = attInfo;
}
return attInfo;
}