Confirmed features of .NET 4.0? [closed]

血红的双手。 提交于 2019-12-04 19:33:48

Parallel Extensions

WCF/WF improvements

I expect BigInteger will be back, too. I'd really like to see a bunch of the F# immutable collections become part of ".NET proper" too - and that wouldn't surprise me at all.

I have seen the usage of dynamic keyword in C# 4.0 from Anders Hejlsberg's JAOO talk. It allows calling methods in a late-bindish way which will really help in COM interop scenarios.

Usage:

// Instead of this:
object calc = GetCalculator();
Type calcType = calc.GetType();
object res = calcType.InvokeMember("Add", 
    BindingFlags.InvokeMethod, null,
    new int[] { 10, 20 });
int sum = Convert.ToInt32(res);

// you can write this:
dynamic calc = GetCalculator();
int sum = calc.Add(10, 20);

Static and Dynamic http://img266.imageshack.us/img266/9469/dynamicxf4.png

Glenn Block confirmed on a recent Herding Code episode that MEF would be part of .NET 4.0.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!