NET 3.0 which is similar to partial
classes. Partial methods are a part of partial classes, where the implementer of one
part of the class just defines the method, and the other implementer can implement
the method. It is not necessary that the second implementer of the class has to
implement the method. If the method is not implemented, the compiler removes
the method signature and all the calls to this method. This helps the developer to
customize the code with his own implementation. It is safe to declare the partial
methods without worrying about the implementation. The compiler will take care
of removing all the calls to the method. Following is an example for defining and
implementing partial methods:
// Defining UpdateItemsList method in Items1.cs file
partial void UpdateItemsList();
//Implemeting UpdateItemsList method in Items2.cs file
partial void UpdateItemsList()
{
// The method Implementation goes here
}
There are some constraints in using partial methods. They are as follows:
1.
Pages:
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36