protected virtual void OnSpokenSentence(string Sentence) { SpokenSentence spoken = new SpokenSentence(); spoken.Sentence = Sentence; OnSpokenSentenceEvent(spoken); }
protected virtual void OnSpokenSentenceEvent(SpokenSentence spokenSentence) { EventHandler <SpokenSentence> handler = SpokenSentenceEvent; if (handler != null) { handler(this, spokenSentence); } }
protected virtual void OnSAPISpeakingSentence(object sender, SpeakProgressEventArgs eventArgs) { IsSpeaking = true; int index = eventArgs.CharacterPosition + eventArgs.CharacterCount; if (index > 0) { index = index - 1; } if (index > SpeakingSentence.Length) { index = SpeakingSentence.Length; } string SpokenString = SpeakingSentence.Substring(0, index); SpokenSentence spokenSentence = new SpokenSentence(); spokenSentence.Sentence = SpokenString; OnSpokenSentenceEvent(spokenSentence); }