List lists for future reference
First, c#2.0
1. Partial class Partial classes
File1.cs
using System; Public Partial class myclass{ publicvoid MyMethod1 () { Console.WriteLine ( "MyMethod1 manually written code ");} }
File2.cs
using System; Public Partial class myclass{ publicvoid MyMethod2 () { Console.WriteLine (" MyMethod2 are usually automatically generated code, such as WebService ");} }
Compile:
Csc/out: Lib . dll/t: library File1.cs file2. /out: App. exe/r: lib. dll App.cs
2. Generics generics
3. Static Class Classes
There can be no instance method in a static class, no instance constructor, and a static constructor, similar to the function of module in the process language
using System; Public Static class utilityclass{ publicstaticvoid Foo () { Console.WriteLine ("Hello"); } }
using System; class app{ staticvoid Main () { utilityclass.foo ();} }
You can see that the static class is not an instance constructor.
A non-static class is one that has an instance constructor.
4. Iterator iterators
5. Anomymous Methods anonymous method
6. Nullable Types Nullable type
7.?? Operator
Object NULL Objectnewreturn// returns obj
Second, C # 3.0
1. LINQ (language-integrated query)
2. Object initializers Objects initializer
3. Colletion initializers Set initializer
4. Anomymous types Anonymous type (var)
5. Lambda Expressions lambda expression
6. Automatic Properties Auto-complete Property
7. Extension Methods Extension method
Third, C # 4.0
1. Optional parameters and named arguments optional parameters and named parameters
Iv. references
C # 2.0:msdn Wikipedia
C # 3.0:msdn Wikipedia
C # 4.0:msdn Wikipedia What's New on C # 4.0
Not finished
Some features of c#2.0 to 4.0