Clear() private method

private Clear ( System.Xml.XmlNodeType nodeType ) : void
nodeType System.Xml.XmlNodeType
return void
コード例 #1
0
        private ValidatingReaderNodeData AddContent(XmlNodeType nodeType)
        {
            Debug.Assert(_contentIndex <= _contentEvents.Length);
            ValidatingReaderNodeData contentInfo = _contentEvents[_contentIndex];

            if (contentInfo != null)
            {
                contentInfo.Clear(nodeType);
                _contentIndex++;
                return(contentInfo);
            }
            if (_contentIndex >= _contentEvents.Length - 1)
            { //reached capacity of array, Need to increase capacity to twice the initial
                ValidatingReaderNodeData[] newContentEvents = new ValidatingReaderNodeData[_contentEvents.Length * 2];
                Array.Copy(_contentEvents, newContentEvents, _contentEvents.Length);
                _contentEvents = newContentEvents;
            }
            contentInfo = _contentEvents[_contentIndex];
            if (contentInfo == null)
            {
                contentInfo = new ValidatingReaderNodeData(nodeType);
                _contentEvents[_contentIndex] = contentInfo;
            }
            _contentIndex++;
            return(contentInfo);
        }
コード例 #2
0
        private ValidatingReaderNodeData AddContent(XmlNodeType nodeType)
        {
            ValidatingReaderNodeData data = this.contentEvents[this.contentIndex];

            if (data != null)
            {
                data.Clear(nodeType);
                this.contentIndex++;
                return(data);
            }
            if (this.contentIndex >= (this.contentEvents.Length - 1))
            {
                ValidatingReaderNodeData[] destinationArray = new ValidatingReaderNodeData[this.contentEvents.Length * 2];
                Array.Copy(this.contentEvents, 0, destinationArray, 0, this.contentEvents.Length);
                this.contentEvents = destinationArray;
            }
            data = this.contentEvents[this.contentIndex];
            if (data == null)
            {
                data = new ValidatingReaderNodeData(nodeType);
                this.contentEvents[this.contentIndex] = data;
            }
            this.contentIndex++;
            return(data);
        }
コード例 #3
0
        private ValidatingReaderNodeData AddAttribute(int attIndex)
        {
            ValidatingReaderNodeData data = this.attributeEvents[attIndex];

            if (data != null)
            {
                data.Clear(XmlNodeType.Attribute);
                return(data);
            }
            if (attIndex >= (this.attributeEvents.Length - 1))
            {
                ValidatingReaderNodeData[] destinationArray = new ValidatingReaderNodeData[this.attributeEvents.Length * 2];
                Array.Copy(this.attributeEvents, 0, destinationArray, 0, this.attributeEvents.Length);
                this.attributeEvents = destinationArray;
            }
            data = this.attributeEvents[attIndex];
            if (data == null)
            {
                data = new ValidatingReaderNodeData(XmlNodeType.Attribute);
                this.attributeEvents[attIndex] = data;
            }
            return(data);
        }
コード例 #4
0
        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, newAttributeEvents, _attributeEvents.Length);
                _attributeEvents = newAttributeEvents;
            }
            attInfo = _attributeEvents[attIndex];
            if (attInfo == null)
            {
                attInfo = new ValidatingReaderNodeData(XmlNodeType.Attribute);
                _attributeEvents[attIndex] = attInfo;
            }
            return(attInfo);
        }