System.Xml.Schema.Datatype_duration.TryParseValue C# (CSharp) Méthode

TryParseValue() private méthode

private TryParseValue ( string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, object &typedValue ) : Exception
s string
nameTable System.Xml.XmlNameTable
nsmgr IXmlNamespaceResolver
typedValue object
Résultat System.Exception
        internal override Exception TryParseValue(string s, XmlNameTable nameTable, IXmlNamespaceResolver nsmgr, out object typedValue)
        {
            Exception exception;
            typedValue = null;

            if (s == null || s.Length == 0)
            {
                return new XmlSchemaException(SR.Sch_EmptyAttributeValue, string.Empty);
            }

            exception = durationFacetsChecker.CheckLexicalFacets(ref s, this);
            if (exception != null) goto Error;

            TimeSpan timeSpanValue;
            exception = XmlConvert.TryToTimeSpan(s, out timeSpanValue);
            if (exception != null) goto Error;

            exception = durationFacetsChecker.CheckValueFacets(timeSpanValue, this);
            if (exception != null) goto Error;

            typedValue = timeSpanValue;

            return null;

        Error:
            return exception;
        }
    }