"• Conditionally including an attribute • Changing the declared type of variable • Switching between different namespaces or type aliases in a using directive— for example: using TestType = #if V2 MyCompany.Widgets.GadgetV2; #else MyCompany.Widgets.Gadget; #endif"
"A consequence of the last point is that a client should never specifically “catch” a contract failure (the ContractException type, in fact, is internal to help enforce that principle). Instead, the client should call the target properly; if it fails, this indicates a bug that should be handled via y"
从Threading in c#知道了作者,进而知道了LINQP ad,c# in a nutshell系列也是早有耳闻,但是书架中已经有不少c#方面的书,所以一直没有读的想法,直到后来偶然浏览了一遍这书电子版的目录,立马就被吸引了,基本上涵盖了日常工作所需的各个方面,而且有很多章节都是平时经常听说,略知皮毛但很少深入的,也是写代码时大部分困难的根源,从目录即能看出作者的经验之丰富,编排之用心。再翻开看几页内容(记得当时看的是COM交互),当场如醍醐灌顶,以前好多疑问均茅塞顿开(也可能是技术一般),于是立马收入囊中,时至今日仍不时翻看两眼,每次都能有所收获,实在是不可多得的好书。