ACAT.Extensions.Default.FunctionalAgents.LectureManager.LectureManagerMainForm.flagLongSentences C# (CSharp) Method

flagLongSentences() private method

If the sentence is longer than a specified length, show it in a different color. SOme TTS engines may have a buffer limit and this flags sentences that will not fit in the buffer
private flagLongSentences ( ) : void
return void
        private void flagLongSentences()
        {
            int bufferSize = getSpeechBufferSize();
            if (bufferSize <= 0)
            {
                return;
            }

            foreach (Sentence sentence in _sentences)
            {
                if (sentence.Length > bufferSize)
                {
                    textBox1.SelectionStart = sentence.Start;
                    textBox1.SelectionLength = sentence.Length;
                    textBox1.SelectionColor = Color.Red;
                }
            }
        }