Avoid the default designer for your IComponent-based classes: how to get the code view always!

Note: this entry has moved.

How many times you create a WebService, an Installer, or more generally, any class that directly or indirectly implements IComponent, and wish it doesn't open the default ComponentDesigner?
The simple way to achieve it is adding the following attribute to your class declaration:

[System.ComponentModel.DesignerCategory("Code")]
public class YouClass : YourComponentBasedClass
		
Now whenever you double-click the class in the solution explorer, the code editor will show up, instead of the designer, all thanks to the DesignerCategoryAttribute.

Published 22 September 2003 03:28 PM by Daniel Cazzulino
Filed under:

Comments

No Comments