Add_Constant() private method

Adds a new constant to the collection of constants contained within this template
private Add_Constant ( abstract_Element NewConstant ) : void
NewConstant SobekCM.Library.Citation.Elements.abstract_Element New constant to add
return void
示例#1
0
        private void process_constants(XmlNodeReader nodeReader, CompleteTemplate ThisCompleteTemplate)
        {
            // Read all the nodes
            while (nodeReader.Read())
            {
                // Get the node name, trimmed and to upper
                string nodeName = nodeReader.Name.Trim().ToUpper();

                // If this is the inputs or constant start tag, return
                if ((nodeReader.NodeType == XmlNodeType.EndElement) && (nodeName == "CONSTANTS"))
                {
                    return;
                }

                // If this is the beginning tag for an element, assign the next values accordingly
                if ((nodeReader.NodeType == XmlNodeType.Element) && (nodeName == "ELEMENT") && (nodeReader.HasAttributes))
                {
                    abstract_Element newConstant = process_element(nodeReader, -1);
                    if (newConstant != null)
                    {
                        newConstant.isConstant = true;
                        ThisCompleteTemplate.Add_Constant(newConstant);
                    }
                }
            }
        }
        private void process_constants( XmlNodeReader nodeReader, CompleteTemplate ThisCompleteTemplate )
        {
            // Read all the nodes
            while ( nodeReader.Read() )
            {
                // Get the node name, trimmed and to upper
                string nodeName = nodeReader.Name.Trim().ToUpper();

                // If this is the inputs or constant start tag, return
                if (( nodeReader.NodeType == XmlNodeType.EndElement ) && ( nodeName == "CONSTANTS" ))
                {
                    return;
                }

                // If this is the beginning tag for an element, assign the next values accordingly
                if (( nodeReader.NodeType == XmlNodeType.Element ) && ( nodeName == "ELEMENT" ) && ( nodeReader.HasAttributes ))
                {
                    abstract_Element newConstant = process_element( nodeReader, -1 );
                    if (newConstant != null)
                    {
                        newConstant.isConstant = true;
                        ThisCompleteTemplate.Add_Constant(newConstant);
                    }
                }
            }
        }