The partial types feature enables one to define a single class, struct or interface across multiple source files. This is particularly useful when dealing with automatically generated code. Prior to the existence of this feature,it was problematic to make changes to a class that contained automatically generated code because any change that required regeneration of the code could alter or remove parts of the code written by hand. With this feature the automatically generated parts of a class can live in one source file while the user generated parts of the class can live in another. This makes it less likely that changes to one will affect the other negatively and vice versa.
A partial class is specified by prefixing the keyword partial to the class declaration. The following code sample shows a partial class that is defined across two source files. Note how methods and properties from one source file can reference members defined in another.