![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
.NET/C#4.0
文章平均质量分 80
维生素CC
if(a=b)a=/*b
展开
-
c#4.0新特性之一: Dynamic Lookup (1)
废话不多说,直接开始。先看程序: Code1class Program2{3 static void Main(string[] args)4 {5 dynamic foo1 = new Foo();6 foo1.Do1();7 foo1.Do2();8 foo1.KissFanweixiao();9 }10}1112public class Foo13{14原创 2008-10-30 00:19:00 · 2803 阅读 · 2 评论 -
C#4.0新特性之二:Named and Optional Parameters
这个特性比较简单,依旧长话多说,只说重点。下面这个demo我们经常使用重载函数来处理问题的场景:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 public void Process(int p1, float p2, string p3)原创 2008-10-31 03:36:00 · 1892 阅读 · 7 评论 -
C#4.0新特性之二:Named and Optional Parameters (2) 剖析篇
在上一篇介绍该特性的文章里, 大家都在说这是vb里已经有的东西. 切不管c#的发展方向, 我们剖析一下这个特性的实现原理:首先,还是看一个例子: 1 class Program 2 { 3 static void Main(string[] args) 4 { 5 var foo1 = new Foo(); 6原创 2008-11-03 03:16:00 · 1966 阅读 · 1 评论