System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement C# (CSharp) Method

ReadReferencingElement() protected method

protected ReadReferencingElement ( string name, string ns, bool elementCanBeType, string &fixupReference ) : object
name string
ns string
elementCanBeType bool
fixupReference string
return object
        protected object ReadReferencingElement(string name, string ns, bool elementCanBeType, out string fixupReference)
        {
            object o = null;

            if (_callbacks == null)
            {
                _callbacks = new Hashtable();
                _types = new Hashtable();
                XmlQualifiedName urType = new XmlQualifiedName(_urTypeID, _r.NameTable.Add(XmlSchema.Namespace));
                _types.Add(urType, typeof(object));
                _typesReverse = new Hashtable();
                _typesReverse.Add(typeof(object), urType);
                InitCallbacks();
            }

            _r.MoveToContent();

            if (ReadReference(out fixupReference)) return null;

            if (ReadNull()) return null;

            string id = _soap12 ? _r.GetAttribute("id", Soap12.Encoding) : _r.GetAttribute("id", null);

            if ((o = ReadArray(name, ns)) == null)
            {
                XmlQualifiedName typeId = GetXsiType();
                if (typeId == null)
                {
                    if (name == null)
                        typeId = new XmlQualifiedName(_r.NameTable.Add(_r.LocalName), _r.NameTable.Add(_r.NamespaceURI));
                    else
                        typeId = new XmlQualifiedName(_r.NameTable.Add(name), _r.NameTable.Add(ns));
                }
                XmlSerializationReadCallback callback = (XmlSerializationReadCallback)_callbacks[typeId];
                if (callback != null)
                {
                    o = callback();
                }
                else
                    o = ReadTypedPrimitive(typeId, elementCanBeType);
            }

            AddTarget(id, o);

            return o;
        }

Same methods

XmlSerializationReader::ReadReferencingElement ( string &fixupReference ) : object
XmlSerializationReader::ReadReferencingElement ( string name, string ns, string &fixupReference ) : object