I am using Visual Studio 2008 with C#. Is there a way to set the default editor for a class file containing a DataTable derived class? Whenever I double click on one of these classes to open the file VS attempts to open a component designer. Since my class isn't compatible with that editor this is a rather useless default. I would like these files to open up in the normal code editor.
Why not just go RightClick->View Code, OR once it's open in the designer press F7.
As a work around: Right-click, open-with... Unless the class file has a different extension, I think you're stuck with this.
Edit: Could you make a small interim command line program that can determine the correct editor by looking at the content, and then open the file with that editor. Then associate that filetype with the interim program. This seems complex, but I've done it before in a similar case.
In the solution explorer within VS you right click the file, select "Open With ...", select CSharp Editor in the window, then click the button to set as default.
You can disable Visual Studio designer for certain classes by using an attribute.
[System.ComponentModel.DesignerCategory("")]
Credit goes to http://vanguard-against-confusion.blogspot.com/2007/05/disable-design-time-support-in-visual.html where I originally found out about this.
One interesting thing though is that if I just write
using System.ComponentModel;
[DesignerCategory("")]
it won't work in my VS2010. Does anyone know why?