什么是采用局部类的? [英] What is the use of a partial class?

查看:130
本文介绍了什么是采用局部类的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何能在局部类是编码有用吗?能详细解释一下的人用的例子吗?

How can a partial class be useful in coding? Can anyone explain in detail with examples?

推荐答案

主要用途是分离的设计器生成的的code从手写$(例如,一个用户界面,或实体) C $℃;两个在编译时一起捣碎,所以你还是只得到一个单独的类,但你没有看到设计师克鲁夫特在看code。

The main use is to separate designer-generated code (e.g. a UI, or entities) from hand-written code; the two are mashed together at compile time, so you still just get a single class, but you don't see the designer cruft when looking at code.

这不是的只有的有用的局面,但它最主要的一个我遇到。

It's not the only useful situation, but it's the main one I've come across.

这篇关于什么是采用局部类的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆