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)); } SchemaNodeShortArray shortarray = schema as SchemaNodeShortArray; if (shortarray != null) { return(VerifyShortArray(tag, shortarray)); } 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))); }
private bool VerifyIntArray(TagNode tag, SchemaNodeIntArray schema) { TagNodeIntArray atag = tag as TagNodeIntArray; if (atag == null) { if (!OnInvalidTagType(new TagEventArgs(schema, tag))) { return(false); } } if (schema.Length > 0 && atag.Length != schema.Length) { if (!OnInvalidTagValue(new TagEventArgs(schema, tag))) { return(false); } } return(true); }
private bool VerifyIntArray(TagNode tag, SchemaNodeIntArray schema) { TagNodeIntArray atag = tag as TagNodeIntArray; if (atag == null) { if (!OnInvalidTagType(new TagEventArgs(schema, tag))) { return false; } } if (schema.Length > 0 && atag.Length != schema.Length) { if (!OnInvalidTagValue(new TagEventArgs(schema, tag))) { return false; } } return true; }