public override bool Equals(object obj) { InstalledVoice installedVoice = obj as InstalledVoice; if (installedVoice == null) { return(false); } if (VoiceInfo.Name == installedVoice.VoiceInfo.Name && VoiceInfo.Age == installedVoice.VoiceInfo.Age && VoiceInfo.Gender == installedVoice.VoiceInfo.Gender) { return(VoiceInfo.Culture.Equals(installedVoice.VoiceInfo.Culture)); } return(false); }
internal static InstalledVoice FirstEnabled(List <InstalledVoice> list, CultureInfo culture) { InstalledVoice installedVoice = null; foreach (InstalledVoice item in list) { if (item.Enabled) { if (Helpers.CompareInvariantCulture(item.VoiceInfo.Culture, culture)) { return(item); } if (installedVoice == null) { installedVoice = item; } } } return(installedVoice); }