October 2010
Intermediate to advanced
1920 pages
73h 55m
English
You can define a single component that spans multiple files by taking advantage of a feature of .NET Framework called partial classes.
For example, the files in Listings 17.15 and 17.16 contain two halves of the same component.
Listing 17.15. FirstHalf.cs

Listing 17.16. SecondHalf.cs

The private _message field is defined in the first file, but this private field is used in the GetMessage() method in the second file. When the GetMessage() method is called, it returns the value of the private field from the other class. ...