【问题标题】:Confirmed features of .NET 4.0? [closed].NET 4.0 的确认功能? [关闭]
【发布时间】:2008-10-25 21:28:20
【问题描述】:

有人知道 .NET 4.0 中会发生什么吗?

我找到tuples on codeplex

....
// NOTE : this is a TEMPORARY and a very minimalistic implementation of Tuple'2, 
// as defined in http://devdiv/sites/docs/NetFX4/CLR/Specs/Base Class Libraries/Tuple Spec.docx
// We will remove this after we move to v4 and Tuple is actually in there
public struct Tuple<TFirst, TSecond>
....

【问题讨论】:

    标签: .net .net-4.0


    【解决方案1】:

    Parallel Extensions

    WCF/WF improvements

    我希望 BigInteger 也会回来。我真的很希望看到一堆 F# 不可变集合也成为“.NET 专有”的一部分 - 这一点也不会让我感到惊讶。

    【讨论】:

      【解决方案2】:

      我从Anders Hejlsberg's JAOO talk 看到了dynamic 关键字在C# 4.0 中的用法。它允许以后期绑定方式调用方法,这对 COM 互操作场景很有帮助。

      用法:

      // 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

      【讨论】:

        【解决方案3】:

        Glenn Block 在最近的 Herding Code 剧集中证实,MEF 将成为 .NET 4.0 的一部分。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多