代码改变世界

随笔档案-2014年08月

委托返回类型的协变性

2014-08-18 08:43 by 张小驴同学, 257 阅读, 收藏,
摘要: class Program { static void Main(string[] args) { StreamFactory factory = GenerateSampleData;//(3) using (S... 阅读全文

委托参数的逆变性

2014-08-13 16:16 by 张小驴同学, 438 阅读, 收藏,
摘要: 读了深入理解C#书中的 5.3.1 委托参数的逆变性,记录一下。先看一段代码:public Form1(){ InitializeComponent(); Button button1 = new Button {Text = "Click me 1", Location = new P... 阅读全文