开发者

How do I not show a Visual Studio designer for an inherited DataTable

My business objects inherit from System.Data.DataTable. When I double-click on one of these classes from the Solution Explorer, it opens in design mode and says "To add components to your class, drag them...". I want it to open like any other class and to show the code. By decompiling the DataTable class using Reflector, I see that it uses the Editor attribute. I tried adding thi开发者_运维问答s to my class with an empty constructor, but the behavior didn't change. I also tried changing the DesignTimeVisible attribute. Here are the attributes for a DataTable:

[Serializable, 
XmlSchemaProvider("GetDataTableSchema"), 
Editor("Microsoft.VSDesigner.Data.Design.DataTableEditor, Microsoft.VSDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), DefaultEvent("RowChanging"), 
DesignTimeVisible(false), 
DefaultProperty("TableName"), 
ToolboxItem(false)]

Any ideas?


Right click on the file and Select "Open With..." Select CSharp Editor (or whatever) And the select "Set As Default"

Then hit OK. From then on double click will open in whatever you selected as default for that class.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜