internal void SetEnabledFlag(bool value, bool switchContext) { try { if (_enabled != value) { _enabled = value; if (!_enabled) { if (_voice.Equals(_voiceSynthesizer.CurrentVoice(switchContext).VoiceInfo)) { _voiceSynthesizer.Voice = null; } } else { _voiceSynthesizer.Voice = null; } } } catch (InvalidOperationException) { _voiceSynthesizer.Voice = null; } }
public override bool Equals(object obj) { TTSVoice tTSVoice = obj as TTSVoice; if (tTSVoice != null) { return(_voiceId.Equals(tTSVoice.VoiceInfo)); } return(false); }