System.Xml.XmlTextReaderImpl.ChangeCurrentNodeType C# (CSharp) Method

ChangeCurrentNodeType() private method

private ChangeCurrentNodeType ( System.Xml.XmlNodeType newNodeType ) : void
newNodeType System.Xml.XmlNodeType
return void
        internal void ChangeCurrentNodeType(XmlNodeType newNodeType)
        {
            Debug.Assert(_curNode.type == XmlNodeType.Whitespace && newNodeType == XmlNodeType.SignificantWhitespace, "Incorrect node type change!");
            _curNode.type = newNodeType;
        }

Usage Example

//
// Internal methods for validators, DOM, XPathDocument etc.
//
        private void ProcessCoreReaderEvent()
        {
            switch (coreReader.NodeType)
            {
            case XmlNodeType.Whitespace:
                if (coreReader.Depth > 0 || coreReaderImpl.FragmentType != XmlNodeType.Document)
                {
                    if (validator.PreserveWhitespace)
                    {
                        coreReaderImpl.ChangeCurrentNodeType(XmlNodeType.SignificantWhitespace);
                    }
                }
                goto default;

            case XmlNodeType.DocumentType:
                ValidateDtd();
                break;

            case XmlNodeType.EntityReference:
                parsingFunction = ParsingFunction.ResolveEntityInternally;
                goto default;

            default:
                coreReaderImpl.InternalSchemaType = null;
                coreReaderImpl.InternalTypedValue = null;
                validator.Validate();
                break;
            }
        }
XmlTextReaderImpl