System.Xml.Schema.Datatype_dayTimeDuration.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;

            XsdDuration duration;
            exception = XsdDuration.TryParse(s, XsdDuration.DurationType.DayTimeDuration, out duration);
            if (exception != null) goto Error;

            TimeSpan timeSpanValue;
            exception = duration.TryToTimeSpan(XsdDuration.DurationType.DayTimeDuration, out timeSpanValue);
            if (exception != null) goto Error;

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

            typedValue = timeSpanValue;

            return null;

        Error:
            return exception;
        }
Datatype_dayTimeDuration