System.ConfigTreeParser.CreateNode C# (CSharp) Method

CreateNode() public method

public CreateNode ( int size, ConfigNodeSubType subType, ConfigNodeType nType, int terminal, [ text, int textLength, int prefixLength ) : void
size int
subType ConfigNodeSubType
nType ConfigNodeType
terminal int
text [
textLength int
prefixLength int
return void
        public void CreateNode(int size,
                               ConfigNodeSubType subType, 
                               ConfigNodeType nType, 
                               int terminal, 
                               [MarshalAs(UnmanagedType.LPWStr)]String text, 
                               int textLength, 
                               int prefixLength)
        {
            //Trace("CreateNode",size,subType,nType,terminal,text,textLength,prefixLength,0);

            if (nType == ConfigNodeType.Element)
            {
				// New Node
                lastProcessed = "<"+text+">";                           
                if (parsing  
                    || (bNoSearchPath &&
                        String.Compare(text, treeRootPath[0], StringComparison.OrdinalIgnoreCase) == 0)
                    || (depth == searchDepth && searchDepth == pathDepth && 
                        String.Compare(text, treeRootPath[pathDepth], StringComparison.OrdinalIgnoreCase) == 0 ))
                    {
                        parsing = true;
                        
                        ConfigNode parentNode = currentNode;
                        currentNode = new ConfigNode(text, parentNode);
                        if (rootNode == null)
                            rootNode = currentNode;
                        else
                            parentNode.AddChild(currentNode);
                    }
                else 
                    depth++;
            }
            else if (nType == ConfigNodeType.PCData)
            {
                // Data node
                if (currentNode != null)
                {
                    currentNode.Value = text;
                }
            }
        }