Zhonghui

每个不曾起舞的日子,都是对生命的辜负

User Tools

Site Tools


程序:csharp:partial

partial

partial是C#的关键字,用partial修饰的class表示是完整class定义的一部分

https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods


以下代码来自官方文档:

// Employee类的定义分为两部分
public partial class Employee
{
    public void DoWork()
    {
    }
}
 
public partial class Employee
{
    public void GoToLunch()
    {
    }
}
/var/www/DokuWikiStick/dokuwiki/data/pages/程序/csharp/partial.txt · Last modified: 2023/04/28 07:02 by zh