public ConditionResult Evaluate(Node initialSearchNode, Node node, Relationship relationship, Descriptor descriptor) { ConditionResult result = new ConditionResult() { IncludeNode = this.IsIncluded, Value = true }; if (TypeConditions != null) { foreach (TypeMatch typeMatch in TypeConditions) { bool isMatch = typeMatch.Evaluate(initialSearchNode, node, relationship, descriptor); if (!isMatch) { //as soon as it doesn't evaluate to true we can break we have our result //we are ANDing all the TypeConditions result.Value = false; break; } } } if (result.Value) { //if we still have a true result check the metadata next if (MetadataConditions != null) { foreach (MetadataMatch metaMatch in MetadataConditions) { bool isMatch = metaMatch.Evaluate(initialSearchNode, node, relationship, descriptor); if (!isMatch) { //as soon as it doesn't evaluate to true we can break we have our result //we are ANDing all the TypeConditions result.Value = false; break; } } } } return(result); }
public ConditionResult Evaluate(Node initialSearchNode, Node node, Relationship relationship, Descriptor descriptor) { ConditionResult result = new ConditionResult() { Action = ActionValue, IncludeNode = true, Value = true }; foreach (Match match in Matches) { ConditionResult matchResult = match.Evaluate(initialSearchNode, node, relationship, descriptor); if (matchResult.IncludeNode == false) { result.IncludeNode = false; } if (!matchResult.Value) { result.Value = false; break; } } return(result); }
public ConditionResult Evaluate(Node initialSearchNode, Node node, Relationship relationship, Descriptor descriptor) { ConditionResult result = new ConditionResult() { IncludeNode = this.IsIncluded, Value = true }; if (TypeConditions != null) { foreach (TypeMatch typeMatch in TypeConditions) { bool isMatch = typeMatch.Evaluate(initialSearchNode, node, relationship, descriptor); if (!isMatch) { //as soon as it doesn't evaluate to true we can break we have our result //we are ANDing all the TypeConditions result.Value = false; break; } } } if (result.Value) { //if we still have a true result check the metadata next if (MetadataConditions != null) { foreach (MetadataMatch metaMatch in MetadataConditions) { bool isMatch = metaMatch.Evaluate(initialSearchNode, node, relationship, descriptor); if (!isMatch) { //as soon as it doesn't evaluate to true we can break we have our result //we are ANDing all the TypeConditions result.Value = false; break; } } } } return result; }
public ConditionResult Evaluate(Node initialSearchNode, Node node, Relationship relationship, Descriptor descriptor) { ConditionResult result = new ConditionResult() { Action = ActionValue, IncludeNode = true, Value = true }; foreach (Match match in Matches) { ConditionResult matchResult = match.Evaluate(initialSearchNode, node, relationship, descriptor); if (matchResult.IncludeNode == false) { result.IncludeNode = false; } if (!matchResult.Value) { result.Value = false; break; } } return result; }