/// <summary> /// Combines a Sub check to an overall check /// </summary> /// <param name="subResult">The sub result.</param> public void KeepBestPossibleMatch(CheckResult subResult) { if (subResult == null || !subResult.PossibleMatch) { return; } if (this.PossibleMatch == false || subResult.ExampleNonMatch.Count < this.ExampleNonMatch.Count) { ExampleNonMatch.Clear(); this.PossibleMatch = true; this.ValueFormatPossibleMatch = subResult.ValueFormatPossibleMatch; foreach (var ex in subResult.ExampleNonMatch) { if (string.IsNullOrEmpty(ex)) { continue; } this.ExampleNonMatch.Add(ex); } } }
/// <summary> /// Combines a Sub check to an overall check /// </summary> /// <param name="subResult">The sub result.</param> public void KeepBestPossibleMatch(CheckResult subResult) { if (subResult == null || !subResult.PossibleMatch) { return; } if (PossibleMatch && subResult.ExampleNonMatch.Count >= ExampleNonMatch.Count) { return; } ExampleNonMatch.Clear(); PossibleMatch = true; ValueFormatPossibleMatch = subResult.ValueFormatPossibleMatch; foreach (var ex in subResult.ExampleNonMatch) { if (!string.IsNullOrEmpty(ex)) { ExampleNonMatch.Add(ex); } } }