luni, 25 august 2014

Partial Class c#

Partial split the definition of a class over  more source files. 
Each source file contains a section of the class definition, and all parts are combined when the application is compiled. 

Use partial class when:
  • working on large projects allows multiple programmers to work on it simultaneously.
  • working with automatically generated source, code can be added to the class without having to recreate the source file.
Example

public partial class Car
{
      public int Year()
     {
      }
}

public partial class Car
{
      public void Go()
     {
      }
}

Niciun comentariu:

Trimiteți un comentariu