为什么不好编辑UIMap.designer.cs文件中的一个Visual Studio codeD UI测试?
我已阅读,它是坏的编辑UIMap.Designer.cs文件,但是,我不明白为什么。
I have read that it is bad to edit the UIMap.Designer.cs file, however, I do not understand why.
每MSDN:
不要修改UIMap.designer.cs文件直接,如果你这样做,更改文件将被覆盖。 http://msdn.microsoft.com/en-us/library/dd380782.aspx
有谁知道什么被覆盖?这是否意味着如果UIMap.uitest文件是设计师文件后编辑,设计师文件被逆转吗?请帮助。
Does anybody know what gets overwritten? Does this mean that if the UIMap.uitest file is edited after the Designer file, the designer file gets reversed? please help.
该UIMap.designer.cs文件从 UIMap.uitest 文件中的每个编辑后再生(即保存)到 UIMap.uitest 文件。有一个在文件中说,它是一个生成的文件顶部的评论和编辑都将丢失。
The UIMap.designer.cs file is regenerated from the UIMap.uitest file after every edit (that is saved) to the UIMap.uitest file. There is a comment at the top of the file saying that it is a generated file and that edits will be lost.
这,乍一看,似乎需要code的编辑在设计文件中可以通过在的UIMap编辑器中显示的操作和UI的控件的属性面板编辑要做的改变大量涌现。一些变化确实需要手动编辑。对于这些有一个命令(按钮或右键单击菜单)移动的动作到 UIMap.cs 文件中,这样可以尽可能所需的编辑和扩展。这两个的UIMap ... CS 文件的指定部分
他们班头这样既有助于相同的UIMap。
Large numbers of changes that, at first sight, appear to need editing of code in the designer file can be done by editing via the properties panels of the actions and UI-controls shown in the UIMap editor. Some changes do need manual editing. For these there is a command (button or right-click-menu) to move an action into the UIMap.cs file where it can be edited and extended as much as desired. Both of these UIMap...cs files specify partial
in their class headers so both contribute to the same UIMap.
当仅有一个方法的一个动作需要手工编辑它可以是值得拆分该方法分成两个或三个片放置动作需要编辑到它自己的方法。 split命令是通过一个按钮或右键菜单可用。已经分离出的动作,其方法可以移动到在 UIMap.cs 文件。
When just one action of a method needs manual editing it can be worth splitting that method into two or three pieces to place the action needing edits into its own method. The split command is available via a button or the right-click-menu. Having isolated the action, its method can be moved into the UIMap.cs file.
在移动方法,然后编辑它们,我建议活动的顺序如下。
When moving methods and then editing them I recommend the following order of activity.
-
如果需要:分割法成片然后重命名使用的UIMap编辑分割方法。保存在 UIMap.uitest 文件导致了设计文件的再生。然后加入到拆分和重新命名方法的调用。构建测试,也许,检查测试仍然正常工作。
If needed: Split the method into pieces then rename the split methods using the UIMap editor. Save the UIMap.uitest file causing regeneration of the designer file. Then add calls to the split and renamed methods. Build the test and, perhaps, check that the test still works as expected.
Move方法到 UIMap.cs 使用的UIMap编辑文件。
Move method into the UIMap.cs file using the UIMap editor.
保存导致设计师文件的再生中的所有文件。省略此保存均可引起混淆的错误C#的文件显示。
Save all files causing regeneration of the designer file. Omitting this save-all can cause confusing errors to be displayed on the C# files.
编辑code刚搬进在 UIMap.cs 文件。
Edit the code just moved into the UIMap.cs file.
用户界面地图编辑器与Visual Studio 2012对于被Feature Pack 2中增加了编辑器的Visual Studio 2010标准。
The UI Map editor is standard with Visual Studio 2012. For Visual Studio 2010 the editor was added by Feature Pack 2.