private AnalyzerLogLine GetNextOriginatingLine(bool caseSensitive, int currentLineIndex, List <string> originatingVoiceCommandTextWords) { if ((currentLineIndex + 1) >= this.Count) { return(null); //After the end of the list. } currentLineIndex++; while (currentLineIndex < this.Count) { if (DataShaper.StringContainsKeywords(this[currentLineIndex].VoiceCommand, caseSensitive, originatingVoiceCommandTextWords)) { return(this[currentLineIndex]); } currentLineIndex++; } return(null); }
private AnalyzerLogLine GetOriginatingLine(bool caseSensitive, int currentLineIndex, List <string> originatingVoiceCommandTextWords) { if ((currentLineIndex - 1) < 0 || (originatingVoiceCommandTextWords == null)) { return(null); //Before the beginning of the list. } currentLineIndex--; while (currentLineIndex > -1) //Traverse back up the list to look for originating line causing the searchVoiceCommandText to be written. { string originatingValueToSearch = caseSensitive ? this[currentLineIndex].VoiceCommand : this[currentLineIndex].VoiceCommand.ToLower(); for (int k = 0; k < originatingVoiceCommandTextWords.Count; k++) { if (DataShaper.StringContainsKeywords(this[currentLineIndex].VoiceCommand, caseSensitive, originatingVoiceCommandTextWords)) { return(this[currentLineIndex]); } } currentLineIndex--; } return(null); }