本文整理汇总了C#中Rule.Validate方法的典型用法代码示例。如果您正苦于以下问题:C# Rule.Validate方法的具体用法?C# Rule.Validate怎么用?C# Rule.Validate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rule
的用法示例。
在下文中一共展示了Rule.Validate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidateRule
private void ValidateRule(Rule rule, BusinessBase businessBase)
{
if (rule.RuleType == RuleType.Custom)
{
rule.Validate(businessBase);
}
else if (!String.IsNullOrEmpty(rule.PropertyName))
{
object value = Shared.FindPropertyValue(rule.PropertyName, businessBase);
rule.Validate(value);
}
}
示例2: Validate
public bool Validate(out string validateMessage, out Rule rule)
{
bool result = true;
rule = new Rule();
validateMessage = "Rule Ok";
if (m_ConditionContainer.m_ConditionList.Count > 0)
{
GraphToRule converter = new GraphToRule(m_TargetObject.GetComponent<State>() as State);
rule.m_Rule = converter.Convert(m_Rule.m_Name, m_ConditionContainer.m_ConditionList[0], m_ActionContainer.m_ActionList);
rule.SetContext(m_TargetObject.GetComponent<InferenceEngine>() as InferenceEngine);
try
{
result = rule.Validate();
}
catch (InvalidRuleException e)
{
validateMessage = e.Message;
}
}
return result;
}