public OcrCharacter GetOcrCharacter(string text, bool addIfNotExists) { foreach (var ocrCharacter in OcrCharacters) { if (ocrCharacter.Text == text) return ocrCharacter; } if (addIfNotExists) { var ch = new OcrCharacter(text); OcrCharacters.Add(ch); return ch; } return null; }
public OcrCharacter GetOcrCharacter(string text, bool addIfNotExists) { foreach (var ocrCharacter in OcrCharacters) { if (ocrCharacter.Text == text) { return(ocrCharacter); } } if (addIfNotExists) { var ch = new OcrCharacter(text); OcrCharacters.Add(ch); return(ch); } return(null); }
/// <summary> /// The get ocr character. /// </summary> /// <param name="text"> /// The text. /// </param> /// <param name="addIfNotExists"> /// The add if not exists. /// </param> /// <returns> /// The <see cref="OcrCharacter"/>. /// </returns> public OcrCharacter GetOcrCharacter(string text, bool addIfNotExists) { foreach (OcrCharacter ocrCharacter in this.OcrCharacters) { if (ocrCharacter.Text == text) { return ocrCharacter; } } if (addIfNotExists) { OcrCharacter ch = new OcrCharacter(text); this.OcrCharacters.Add(ch); return ch; } return null; }