Ejemplo n.º 1
0
        private bool VerifyScaler(TagNode tag, SchemaNodeScaler schema)
        {
            if (!tag.IsCastableTo(schema.Type))
            {
                if (!OnInvalidTagType(new TagEventArgs(schema.Name, tag)))
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        private bool Verify(TagNode parent, TagNode tag, SchemaNode schema)
        {
            if (tag == null)
            {
                return(OnMissingTag(new TagEventArgs(schema.Name)));
            }

            SchemaNodeScaler scaler = schema as SchemaNodeScaler;

            if (scaler != null)
            {
                return(VerifyScaler(tag, scaler));
            }

            SchemaNodeString str = schema as SchemaNodeString;

            if (str != null)
            {
                return(VerifyString(tag, str));
            }

            SchemaNodeArray array = schema as SchemaNodeArray;

            if (array != null)
            {
                return(VerifyArray(tag, array));
            }

            SchemaNodeIntArray intarray = schema as SchemaNodeIntArray;

            if (intarray != null)
            {
                return(VerifyIntArray(tag, intarray));
            }

            SchemaNodeList list = schema as SchemaNodeList;

            if (list != null)
            {
                return(VerifyList(tag, list));
            }

            SchemaNodeCompound compound = schema as SchemaNodeCompound;

            if (compound != null)
            {
                return(VerifyCompound(tag, compound));
            }

            return(OnInvalidTagType(new TagEventArgs(schema.Name, tag)));
        }