下面的类型是C# 2.0 扩展的类型. 下面介绍一下partial类型.
Generics
Anonymous Methods
Iterators
Partial Types
Nullable Types

Partial Types

Partial types allow classes, structs, and interfaces to be broken into multiple pieces stored in different source files for easier development and maintenance. To define a type in multiple parts, use the modifier partial?
具体的语法:


Rules for Partial Types
  • Each part of a partial type declaration must include a partial modifier and must be declared in the same namespace as the other parts.
  • The partial modifier indicates that additional parts of the type declaration may exist elsewhere, but the existence of such additional parts is not mandatory.
  • All parts of a partial type must be complied together, such that the parts can be merged at compile time.

Nested types can be defined in multiple parts by using the partial modifier. As already mentioned partial types can be used with class, structs, and interfaces. The partial modifier is not permitted on delegate or enum declarations.

呵呵! 这是摘抄