public RowValidate(XmlElement rowDescription, RowValidatorCollection RVList, ConditionCollection CondList) { Validators = RVList; Conditions = CondList; Statements = new ValidateStatements(rowDescription); }
/// <summary> /// 載入驗證規則 /// </summary> /// <param name="XmlNode"></param> public void LoadRule(XmlElement XmlNode) { FieldValidators = new FieldValidatorCollection(XmlNode.SelectSingleNode("ValidatorList") as XmlElement); RowValidators = new RowValidatorCollection(XmlNode.SelectSingleNode("ValidatorList") as XmlElement); Conditions = new ConditionCollection(XmlNode.SelectSingleNode("ConditionList") as XmlElement); FieldValidate = new FieldValidate(XmlNode.SelectSingleNode("FieldList") as XmlElement, FieldValidators, Conditions); RowValidate = new RowValidate(XmlNode.SelectSingleNode("RowValidate") as XmlElement, RowValidators, Conditions); Duplication = new DuplicateDetection(XmlNode.SelectSingleNode("DuplicateDetection") as XmlElement); //MappingTables = LoadMappingTable(XmlNode.SelectSingleNode("MappingTable") as XmlElement); //DataSources = LoadDataSource(XmlNode.SelectSingleNode("DataSource") as XmlElement); FieldValidate.AutoCorrect += new EventHandler<AutoCorrectEventArgs>(mFieldValidate_AutoCorrect); FieldValidate.ErrorCaptured += new EventHandler<ErrorCapturedEventArgs>(mFieldValidate_ErrorCaptured); RowValidate.AutoCorrect += new EventHandler<AutoCorrectEventArgs>(mRowValidate_AutoCorrect); RowValidate.ErrorCaptured += new EventHandler<ErrorCapturedEventArgs>(mRowValidate_ErrorCaptured); }