文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>C# 5.0将带来的五大新特性

C# 5.0将带来的五大新特性

时间:2010-10-15  来源:香山飘雪

comboBox1.Text :=: textBox1.Text; //将文本框的内容绑定到下拉框。

 

第二:带参数的泛型构造函数:

public class T MyClass : T: class, new()

//we might have 

 public class T MyClass : T:class, new(int)

 

第三:支持null类型运算:

int x? = null;

int y? = x + 40;

 

Myobject obj = null;

Myotherobj obj2 = obj.MyProperty ??? new Myotherobj();

 

第四:case表达式,支持表达式:

switch(myobj){

 case string.IsNullorEmpty(myotherobj):

 ..... 

  case myotherobj.Trim().Lower: 

 ....

}

 

第五:扩展属性。

[Associate(string)]public static int MyExtensionProperty { get;set;}

相关阅读 更多 +
排行榜 更多 +
我的兵与城(内置功能菜单)

我的兵与城(内置功能菜单)

休闲益智 下载
语音包变声吧

语音包变声吧

游戏工具 下载
粉碎赛车竞速

粉碎赛车竞速

体育竞技 下载