예제 #1
0
        public override bool Equals(object obj)
        {
            InstalledVoice ti2 = obj as InstalledVoice;

            if (ti2 == null)
            {
                return(false);
            }

            return(VoiceInfo.Name == ti2.VoiceInfo.Name && VoiceInfo.Age == ti2.VoiceInfo.Age && VoiceInfo.Gender == ti2.VoiceInfo.Gender && VoiceInfo.Culture.Equals(ti2.VoiceInfo.Culture));
        }
예제 #2
0
        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);
        }
예제 #3
0
        internal static InstalledVoice FirstEnabled(List <InstalledVoice> list, CultureInfo culture)
        {
            InstalledVoice voiceFirst = null;

            foreach (InstalledVoice ti in list)
            {
                if (ti.Enabled)
                {
                    if (Helpers.CompareInvariantCulture(ti.VoiceInfo.Culture, culture))
                    {
                        return(ti);
                    }
                    voiceFirst ??= ti;
                }
            }
            return(voiceFirst);
        }
예제 #4
0
        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);
        }