Partial Classes in C#

后端 未结 20 3071
时光说笑
时光说笑 2021-02-19 07:59

Are there are good uses of Partial Classes outside the webforms/winforms generated code scenarios? Or is this feature basically to support that?

20条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-19 09:04

    Anywhere you'd have used #region sections before probably makes more sense as separate files in partial classes.

    I personally use partial classes for large classes where static members go in one file and instance members go in the other one.

提交回复
热议问题