无法分配方法组到一个隐式类型的局部变量 [英] Cannot assign method group to an implicitly-typed local variable

查看:288
本文介绍了无法分配方法组到一个隐式类型的局部变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的错误。




无法分配方法组到一个隐式类型的局部变量




在此代码

 专用异步无效Button_Click_2(对象发件人, RoutedEventArgs E)
{
VAR frenchvoice = InstalledVoices.All.Where(语音= GT; voice.Language.Equals(FR-FR)及voice.Gender == VoiceGender.Female).FirstOrDefault ; //在此行中
sp.SetVoice(frenchvoice);
等待sp.SpeakTextAsync(mytxt);
}


解决方案

您忘了调用该函数(与()


I have this error

"Cannot assign method group to an implicitly-typed local variable"

in this code

private async void Button_Click_2(object sender, RoutedEventArgs e)
{
    var frenchvoice = InstalledVoices.All.Where(voice => voice.Language.Equals("fr-FR") & voice.Gender == VoiceGender.Female).FirstOrDefault; // in this line
    sp.SetVoice(frenchvoice);
    await sp.SpeakTextAsync(mytxt);
}

解决方案

You forgot to call the function (with ())

这篇关于无法分配方法组到一个隐式类型的局部变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆