Export (0) Print
Expand All

partial (C# Reference)

Partial type definitions allow the definition of a class, struct or interface to be split into multiple files.

In File1.cs:

namespace PC
{
    partial class A { }
}

In File2.cs:

namespace PC
{
    partial class A { }
}

Splitting a class, struct or interface type over several files can be useful when working with large projects, or with automatically generated code such as that provided by the Windows Forms Designer. For more information, see Partial Classes.

For more information, see the following sections in the C# Language Specification:

  • 19.4 Partial types

  • 23 Partial Types

Community Additions

ADD
Show:
© 2014 Microsoft