System.Xml.XsdValidatingReader.InternalReadContentAsObjectTupleAsync C# (CSharp) Méthode

InternalReadContentAsObjectTupleAsync() private méthode

private InternalReadContentAsObjectTupleAsync ( bool unwrapTypedValue ) : object>>.Task
unwrapTypedValue bool
Résultat object>>.Task
        private async Task<Tuple<string, object>> InternalReadContentAsObjectTupleAsync(bool unwrapTypedValue)
        {
            Tuple<string, object> tuple;
            string originalStringValue;

            XmlNodeType nodeType = this.NodeType;
            if (nodeType == XmlNodeType.Attribute)
            {
                originalStringValue = this.Value;
                if (_attributePSVI != null && _attributePSVI.typedAttributeValue != null)
                {
                    if (_validationState == ValidatingReaderState.OnDefaultAttribute)
                    {
                        XmlSchemaAttribute schemaAttr = _attributePSVI.attributeSchemaInfo.SchemaAttribute;
                        originalStringValue = (schemaAttr.DefaultValue != null) ? schemaAttr.DefaultValue : schemaAttr.FixedValue;
                    }

                    tuple = new Tuple<string, object>(originalStringValue, ReturnBoxedValue(_attributePSVI.typedAttributeValue, AttributeSchemaInfo.XmlType, unwrapTypedValue));
                    return tuple;
                }
                else
                { //return string value
                    tuple = new Tuple<string, object>(originalStringValue, this.Value);
                    return tuple;
                }
            }
            else if (nodeType == XmlNodeType.EndElement)
            {
                if (_atomicValue != null)
                {
                    originalStringValue = _originalAtomicValueString;

                    tuple = new Tuple<string, object>(originalStringValue, _atomicValue);
                    return tuple;
                }
                else
                {
                    originalStringValue = string.Empty;

                    tuple = new Tuple<string, object>(originalStringValue, string.Empty);
                    return tuple;
                }
            }
            else
            { //Positioned on text, CDATA, PI, Comment etc
                if (_validator.CurrentContentType == XmlSchemaContentType.TextOnly)
                {  //if current element is of simple type
                    object value = ReturnBoxedValue(await ReadTillEndElementAsync().ConfigureAwait(false), _xmlSchemaInfo.XmlType, unwrapTypedValue);
                    originalStringValue = _originalAtomicValueString;

                    tuple = new Tuple<string, object>(originalStringValue, value);
                    return tuple;
                }
                else
                {
                    XsdCachingReader cachingReader = _coreReader as XsdCachingReader;
                    if (cachingReader != null)
                    {
                        originalStringValue = cachingReader.ReadOriginalContentAsString();
                    }
                    else
                    {
                        originalStringValue = await InternalReadContentAsStringAsync().ConfigureAwait(false);
                    }

                    tuple = new Tuple<string, object>(originalStringValue, originalStringValue);
                    return tuple;
                }
            }
        }
XsdValidatingReader