System.Xml.Schema.XmlSchemaValidator.CheckElementValue C# (CSharp) Method

CheckElementValue() private method

private CheckElementValue ( string stringValue ) : object
stringValue string
return object
        private object CheckElementValue(string stringValue)
        {
            object typedValue = null;
            SchemaDeclBase decl = _context.ElementDecl as SchemaDeclBase;

            XmlSchemaDatatype dtype = decl.Datatype;
            Debug.Assert(dtype != null);

            Exception exception = dtype.TryParseValue(stringValue, _nameTable, _nsResolver, out typedValue);
            if (exception != null)
            {
                SendValidationEvent(SR.Sch_ElementValueDataTypeDetailed, new string[] { QNameString(_context.LocalName, _context.Namespace), stringValue, GetTypeName(decl), exception.Message }, exception);
                return null;
            }
            if (!decl.CheckValue(typedValue))
            {
                SendValidationEvent(SR.Sch_FixedElementValue, QNameString(_context.LocalName, _context.Namespace));
            }
            return typedValue;
        }