摘要:
Type.GetType gives us the ability to get type back from a string. We pass a well-written type name string to it, and expect it return that type. Sometimes, to your surprise, it returns null. For example, Type.GetType("System.Data.SqlClient.SqlException"). If the assembly name is specified 阅读全文
摘要:
修饰符作用:修饰符用于限定类型以及类型成员的申明。C#中修饰符种类:C#中有13种修饰符,按功能可分为三部分:存取修饰符,类修饰符和成员修饰符. 存取修饰符:public:存取访问不受限制.private:只有包含该成员的类可以存取.当前类才能访问internal:只有当前工程可以存取.只限于类所在的命名空间(不包括子类)protected:只有包含该成员的类以及继承的类可以存取.类修饰符:abstract:抽象类,可以被指示一个类只能作为其它类的基类.必须被继承和重写的sealed:密封类,指示一个类不能被继承.防止该类被其它类继承partial:部分类,可以将一个类、结构或接口的定义拆分到 阅读全文
摘要:
The implementation of anonymous methods in C# and its consequences (part 1)You may not even have realized thatthere are two types of anonymous methods.I'll call them the easy kind and the hard kind,not because they're actually easy and hard for you the programmer,but because they are easy an 阅读全文
摘要:
C#中Event的概念:C#中的事件处理实际上是一种具有特殊签名的delegate。public delegate void MyEventHandler(object sender, MyEventArgs e);其中的两个参数,sender代表事件发送者,e是事件参数类。MyEventArgs类用来包含与事件相关的数据,所有的事件参数类都必须从System.EventArgs类派生。当然,如果你的事件不含参数,那么可以直接用System.EventArgs类作为参数。实现Event的步骤:1. 定义delegate对象类型,它有两个参数,第一个参数是事件发送者对象,第二个参数是事件参数类对 阅读全文
摘要:
Download source, examples, tests, and demo - 579 KBSee the History section at the bottom for changes.Basic usageThis is a Thread Pool; if you got here, you probably know what you need. If you want to understand the features and know how it works, keep reading the sections below. If you just want to 阅读全文