*了.Designer.cs文件的手工编辑 [英] Manual editing of *.designer.cs file

查看:112
本文介绍了*了.Designer.cs文件的手工编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道,那了.Designer.cs 文件包含由Visual Studio中的可视化表单设计器生成的数据。不过,我有一些额外的方法,虽然,这我想放到了.Designer.cs 文件为好,因为这些负责低级形式处理(例如,我的视觉状态经理件)。

I'm aware, that the .designer.cs file contains data generated by the visual form designer in Visual Studio. However, I have some additional methods though, which I want to put into the .designer.cs file as well, because these are responsible for lower-level form handling (for example, pieces of my visual state manager).

了.Designer.cs 文件中的的InitializeComponent 方法有评论指出,这是自动生成的,不应该被用户修改。这是否限制只适用于该法或不应该在了.Designer.cs 文件被用户在所有的编辑?我注意到,这在其他中,它包含的Dispose()方法,用户可能要修改 - 有什么建议的第一个选项。我想可以肯定,虽然。

The InitializeComponent method inside the .designer.cs file has a comment stating, that it is automatically generated and should not be modified by user. Does this restriction apply only to that method or shouldn't the .designer.cs file be edited by user at all? I've noticed, that among others, it contains the Dispose() method, which the user might want to modify - what suggests the first option. I want to be sure, though.

推荐答案

您永远不应该修改了.Designer.cs 。期。您的更改将毫不留情被覆盖。

You should never modify .designer.cs. Period. Your changes will be overwritten without mercy.

更新:要多一点帮助,因为V3(VS 2008)包括了部分的方法,其中许多设计人员现在将用来让你实现自定义行为C#

Update: To be a bit more helpful, C# since v3 (VS 2008) has included partial methods, which many designers will now use to let you implement custom behavior.

这篇关于*了.Designer.cs文件的手工编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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