Partial type
In this chapter you will learn:
What is partial type
We can use partial
type modifier to
split the type definition into more than one files.
The following code shows how to use the
partial
keyword.
File: Rectangle1.cs
partial class Rectangle{
}
File: Rectangle2.cs
partial class Rectangle{
}
Members cannot be duplicated across partial types.
Partial method
Partial type can have partial methods.
partial class Rectangle{
partial void calculate();
/*j a v a 2s. co m*/
}
partial class Rectangle{
partial void calculate(){
Console.WriteLine("doing the calculation");
}
}
Next chapter...
What you will learn in the next chapter:
Home » C# Tutorial » Class