System.Xml.Xsl.XsltOld.RecordBuilder.DeclareNamespace C# (CSharp) Method

DeclareNamespace() private method

private DeclareNamespace ( string nspace, string prefix ) : void
nspace string
prefix string
return void
        private void DeclareNamespace(string nspace, string prefix) {
            int index = NewNamespace();

            Debug.Assert(this.namespaceList[index] != null && this.namespaceList[index] is BuilderInfo);

            BuilderInfo ns = (BuilderInfo) this.namespaceList[index];
            if (prefix == this.atoms.Empty) {
                ns.Initialize(this.atoms.Empty, this.atoms.Xmlns, this.atoms.XmlnsNamespace);
            }
            else {
                ns.Initialize(this.atoms.Xmlns, prefix, this.atoms.XmlnsNamespace);
            }
            ns.Depth = this.recordDepth;
            ns.NodeType = XmlNodeType.Attribute;
            ns.Value = nspace;

            this.scopeManager.PushNamespace(prefix, nspace);
        }