예제 #1
0
 protected XmlBaseReader()
 {
     _bufferReader = new XmlBufferReader(this);
     _nsMgr = new NamespaceManager(_bufferReader);
     _quotas = XmlDictionaryReaderQuotas.Max;
     _rootElementNode = new XmlElementNode(_bufferReader);
     _atomicTextNode = new XmlAtomicTextNode(_bufferReader);
     _node = s_closedNode;
 }
예제 #2
0
 protected XmlBaseReader()
 {
     this.bufferReader = new XmlBufferReader(this);
     this.nsMgr = new NamespaceManager(bufferReader);
     this.quotas = new XmlDictionaryReaderQuotas();
     this.rootElementNode = new XmlElementNode(bufferReader);
     this.atomicTextNode = new XmlAtomicTextNode(bufferReader);
     this.node = closedNode;
 }
예제 #3
0
        void SetJsonNameWithMapping(XmlElementNode elementNode)
        {
            Namespace ns = AddNamespace();
            ns.Prefix.SetValue(PrefixHandleType.A);
            ns.Uri.SetConstantValue(StringHandleConstStringType.Item);
            AddXmlnsAttribute(ns);

            XmlAttributeNode attribute = AddAttribute();
            attribute.LocalName.SetConstantValue(StringHandleConstStringType.Item);
            attribute.Namespace.Uri.SetValue(0, 0);
            attribute.Prefix.SetValue(PrefixHandleType.Empty);
            attribute.Value.SetValue(ValueHandleType.UTF8, elementNode.NameOffset, elementNode.NameLength);

            elementNode.NameLength = 0;
            elementNode.Prefix.SetValue(PrefixHandleType.A);
            elementNode.LocalName.SetConstantValue(StringHandleConstStringType.Item);
            elementNode.Namespace = ns;
        }
예제 #4
0
 protected XmlElementNode EnterScope()
 {
     if (_depth == 0)
     {
         if (_rootElement)
             XmlExceptionHelper.ThrowMultipleRootElements(this);
         _rootElement = true;
     }
     _nsMgr.EnterScope();
     _depth++;
     if (_elementNodes == null)
     {
         _elementNodes = new XmlElementNode[4];
     }
     else if (_elementNodes.Length == _depth)
     {
         XmlElementNode[] newElementNodes = new XmlElementNode[_depth * 2];
         Array.Copy(_elementNodes, 0, newElementNodes, 0, _depth);
         _elementNodes = newElementNodes;
     }
     XmlElementNode elementNode = _elementNodes[_depth];
     if (elementNode == null)
     {
         elementNode = new XmlElementNode(_bufferReader);
         _elementNodes[_depth] = elementNode;
     }
     _attributeCount = 0;
     _attributeStart = -1;
     _attributeIndex = -1;
     MoveToNode(elementNode);
     return elementNode;
 }
예제 #5
0
 protected XmlElementNode EnterScope()
 {
     if (depth == 0)
     {
         if (rootElement)
             XmlExceptionHelper.ThrowMultipleRootElements(this);
         rootElement = true;
     }
     nsMgr.EnterScope();
     depth++;
     if (depth > quotas.MaxDepth)
         XmlExceptionHelper.ThrowMaxDepthExceeded(this, quotas.MaxDepth);
     if (elementNodes == null)
     {
         elementNodes = new XmlElementNode[4];
     }
     else if (elementNodes.Length == depth)
     {
         XmlElementNode[] newElementNodes = new XmlElementNode[depth * 2];
         Array.Copy(elementNodes, newElementNodes, depth);
         elementNodes = newElementNodes;
     }
     XmlElementNode elementNode = elementNodes[depth];
     if (elementNode == null)
     {
         elementNode = new XmlElementNode(bufferReader);
         elementNodes[depth] = elementNode;
     }
     this.attributeCount = 0;
     this.attributeStart = -1;
     this.attributeIndex = -1;
     MoveToNode(elementNode);
     return elementNode;
 }
예제 #6
0
 /// <inheritdoc/>
 public new XmlElement this[string xml_element_name] {
     get { return(GetXmlElement(xml_element_name)); }
     internal set { base[xml_element_name] = new XmlElementNode(value); }
 }
예제 #7
0
 /// <inheritdoc/>
 public new XmlElement this[string xml_element_name] {
   get { return GetXmlElement(xml_element_name); }
   internal set { base[xml_element_name] = new XmlElementNode(value); }
 }