菜单
  

    While we’re on the subject of conveniences, C# 3.0 also introduces two new features that help when instantiating and initializing object instances. Using object and collection initializers, you can instantiate and initialize either an object or a collection in one compound statement.
    Extension methods are one of the most exciting new features. Taken from the surface view, they are merely static methods that can be called as if they were instance methods. They do not get any special access into the instance they are operating on, so in that respect, they are just like static methods. However, the syntax they foster allows us to program in a more functional manner, usually resulting in clearer and more readable code.
    Probably more compelling than extension methods is support for lambda expressions. Lambda expressions supersede support for anonymous methods. That is, if lambda expressions had existed in C# 2.0, there would have been no need for anonymous methods at all. However, lambda expressions offer much more than anonymous methods as they can be converted into both delegates and expression trees.    The granddaddy of all new C# 3.0 features has to be LINQ, which builds upon all of the new features, especially extension methods, lambda expressions, and anonymous types. It also adds some new language keywords to allow us to code intuitive query statements, thus seamlessly bridging the gap between the object-oriented world and the data world. You can use LINQ to access data from multiple sources. Visual Studio provides the capability to use LINQ on native object collections, SQL data stores, and XML. Support for many other data sources is coming soon from both Microsoft and third parties. For example, you’ll be able to use LINQ to connect to Windows Management Instrumentation (WMI), the Document Object Model (DOM), and the Web. Additionally,there are implementations in the works to use LINQ against popular web sites such as Google and Flickr.
    B.原文的翻译
    对C# 2.0和C# 3.0的新功能概述
    2000年底发布了C#语言,C#逐步被熟知和认可,发展势头迅猛。随着Visual Studio 2005和.NET Framework2.0的发布,C#编译器实现了对C# 2.0增强功能的语言支持。因此C# 2.0更先进,它提供了一个更自然的编程环境,而且大大提高工作效率。论文网
    C# 2.0中丰富了的更新内容,它是对泛型的支持。其语法和C++模板相似,但两者主要区别是,在.NET泛型创建的构造类型为动态,在运行运行时构建。而C++是由模板创建的具体类型,为静态,在编译时创建它们的约束。
    C#中的容器类型如矢量、哈希表,使用泛型可以提供最大的效率增益,该方法很可行。泛型不是使用的所有对象,它们包含特别的类型,而并非是使用所有对象的基类System.Object。
    C#的匿名方法对委托及事件帮助性很大。委托及事件是用来触发注册,称作回调方法的构建,常常被连接到定义方法的地方。对于匿名方法,可以定义事件或委托的代码内联,在事件或委托中进行设置。这方便可行,若代理仅需要执行少量的工作,就不必定义其整个方法。而且,匿名方法体可以对范围在一点上是defined.Lambda的所有表达式变量进行访问,这是C# 3.0可以实现的新功能,是更可读的代码。
  1. 上一篇:JSP技术的发展历程英文文献和中文翻译
  2. 下一篇:探索Activity的生命周期英文文献和中文翻译
  1. 汽车内燃机连杆载荷和应...

  2. 机械手系统英文文献和中文翻译

  3. 固体氧化物燃料电池英文文献和中文翻译

  4. 船舶运动仿真系统英文文献和中文翻译

  5. 新能源空调系统设计英文文献和中文翻译

  6. 正交试验回归法和响应曲...

  7. 机械设计制造及其自动化英文文献和中文翻译

  8. 现代简约美式风格在室内家装中的运用

  9. 中国传统元素在游戏角色...

  10. g-C3N4光催化剂的制备和光催化性能研究

  11. 江苏省某高中学生体质现状的调查研究

  12. C++最短路径算法研究和程序设计

  13. NFC协议物理层的软件实现+文献综述

  14. 巴金《激流三部曲》高觉新的悲剧命运

  15. 上市公司股权结构对经营绩效的影响研究

  16. 高警觉工作人群的元情绪...

  17. 浅析中国古代宗法制度

  

About

优尔论文网手机版...

主页:http://www.youerw.com

关闭返回