What's New for Visual C# 6.0
https://msdn.microsoft.com/en-us/library/hh156499.aspx
You can get the unqualified string name of a type or member for use in an error message without hard coding a string. This allows your code to remain correct when refactoring. This feature is also useful for hooking up model-view-controller MVC links and firing property changed events.
You can use string interpolation expressions to construct strings. An interpolated string expression looks like a template string that contains expressions. C# creates a string by replacing the expressions with the ToString represenations of the expressions’ results. An interpolated string is easier to understand with respect to arguments than Composite Formatting.
Null-conditional Member Access and Indexing
You can test for null in a very light syntactic way before performing a member access (?.) or index (?[]) operation. These operators help you write less code to handle null checks, especially for descending into data structures. If the left operand or object reference is null, the operations returns null.
You can now initialize specific elements of a collection that supports indexing, such as initializing a dictionary.
Collection Initializer and Add Extension Methods
You can use initializers for collections now when the collection has an Add Extension method. Previously the Add method had to be an instance method.
Overload Resolution
The compiler has improved overload resolution that results in more code just working the way you would expect it to behave. One place where you might stop noticing a problem is when choosing between overloads taking nullable value types, or when passing method groups (instead of lambdas) to overloads that take delegates.
You can use exception filers in catch clauses to determine whether a catch clause should handle the exception. Without this feature, you have to rethrow the exception, which clips the call stack reported in the rethrown exception.
Await in Catch and Finally Blocks
You can use await in catch and finally clauses.
You can initialize auto-properties now similarly to how you initialize fields.
You can define read-only auto-properties now without having to define a property with complete property syntax. You can initialize the property where you declare it or in the type’s constructor.
Function Members with Expression Bodies
You can declare members with expression-bodies of code in the same lightweight syntax you use with lambda expressions. See Methods (C# Programming Guide), Properties (C# Programming Guide), Indexers (C# Programming Guide), and Overloadable Operators (C# Programming Guide).
You can import accessible static members of static types so that you can refer to the members without qualifying the access with the type’s name.
What's New for Visual C# 6.0的更多相关文章
- 微软Visual Studio Code 0.8.0发布,新增多种主题
月30日,Build 开发者大会上,正式宣布了 Visual Studio Code 项目;并将其定义为:一个运行于 Mac OS X.Windows和 Linux 之上的,针对于编写现代 Web 和 ...
- Microsoft Visual SourceSafe 6.0 无法关联项目
最近遇到Microsoft Visual SourceSafe 6.0 安装好以后, 无法关联项目,导致无法进行版本控制,研究以后,发现需要运行一个程序,在安装目录下 ..\Visual Source ...
- Xamarin For Visual Studio 3.0.54.0 完整离线破解版(C# 开发Android、IOS工具 吾乐吧软件站分享)
Xamarin For Visual Studio就是原本的Xamarin For Android 以及 Xamarin For iOS,最新版的已经把两个独立的插件合并为一个exe安装包了.为了区分 ...
- 又一次的Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)
~~~~~~~~~~~My problem is here~~~~~~~~~~~~~~~~~~~~~~ Error: Microsoft visual C++ 10.0 is required (un ...
- Win7 64下Visual C++ 6.0不兼容
Win7 64下Visual C++ 6.0不兼容 安装VSE6.0: 1.运行setup.exe安装程序,会弹出如下的的 程序兼容性助手 提示框,这个是Win7在警告用户vc6存在兼容性问题:此程序 ...
- Visual C++ 6.0使用教程
Visual C++它大概可以分成三个主要的部分: 3. Platform SDK.这才是Visual C++和整个Visual Studio的精华和灵魂,虽然我们很少能直接接触到它.大致说来,Pla ...
- pip安装包报错:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat
pip安装包报错:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat Windows7下pip安装包报错:Microso ...
- Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat)
在windows下使用python时,比如编译python的一个包,会遇到这个问题: error: Microsoft Visual C++ 9.0 is required (Unable to fi ...
- Windows下pip安装包报错:Microsoft Visual C++ 9.0 is required Unable to find vcvarsall.bat
刚在机器上windows环境下装上pip方便以后安装包的时候使用,谁知道第一次使用pip安装asyncio的时候就报错. 在Windows7x64下使用pip安装包的时候提示报错:Microsoft ...
- 使用pip安装python插件的时候出现Microsoft Visual C++ 9.0缺失错误
使用pip安装python插件的时候出现Microsoft Visual C++ 9.0缺失错误 使用pip安装python插件的时候出现Microsoft Visual C++ 9.0缺失错误 : ...
随机推荐
- IEEE802是一个局域网标准系列
视频教程 http://v.youku.com/v_show/id_XNjgyODA0NzE2.html?from=s1.8-1-1.2 干线 总线+环形网的传递机制 环形令牌总线 802.4
- 怎么直接在MySQL客户端上执行SQl文件?
\. 直接把sql文件拖进去就行了,(斜杠+.+空格+sql文件)
- SQL Server数据库事务日志序列号(LSN)介绍
原文:http://blog.csdn.net/tjvictor/article/details/5251463 日志序列编号(LSN)是事务日志里面每条记录的编号. 当你执行一次备份时,一些 ...
- 在云服务器搭建WordPress博客(四)WordPress的基本设置
前面说了 如何安装WordPress,接下来我们需要快速熟悉WordPress,以及进行一些必要的基本设置. 开始设置之前,建议大家先点击一篇左边菜单栏的每一个选项,看看到底是做什么用的.下面开始说一 ...
- Jquery 查看DOM上绑定的事件列表
$(dom).data( "events" ); 包括事件类型和关联的处理函数 下面是firefox的截图
- 移动端页面使用rem来做适配
文/九彩拼盘(简书作者)原文链接:http://www.jianshu.com/p/eb05c775d3c6著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”. rem介绍 rem(font ...
- 【BZOJ】【1272】【BeiJingWC2008】Gate of Babylon
组合数学+容斥原理 Orz zyf-zyf 多重集组合数0.0还带个数限制? ——> <组合数学>第6章 6.2带重复的组合 组合数还要模P 0.0? ——> Lucas ...
- PHP杂记
SOAP: 感觉是类似于Java中的HttpClient的东西,和curl也有点像. PHPStorm中查看所有的函数结构(Structure):Alt+7 查找方法或类(Symbol Name 函数 ...
- oracle 字符集
---- 在国内外大中型数据库管理系统中,把ORACLE作为数据库管理平台的用户比较多.ORACLE 不论是数据库管理能力还是安全性都是无可非议的,但是,它在汉字信息的显示方面着实给中国用户带来不少麻 ...
- Sqlitekit 封装管理
最近需要用到Sqlite数据库来做一个游戏的数据存储.网上搜了一下,两种方法,一种是自己dll搭建环境有可能还需要编译之类的,我自己是搭建出来了,不过我没采用. 还有一种就是使用sqlitekit插件 ...