Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

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

© 2015 Microsoft