Where did the old C# class wizards go?
I have Visual Studios 2010 Pro
I read that apparently the older versions of Visual Studios use to have a Wizard for adding classes in C#. It allowed all sorts of things like baseclass and interface methods.
http://msdn.microsoft.com/e开发者_JAVA百科n-us/library/aa288077(v=VS.71).aspx
These features are now all in the editor itself.
Adding a base class is trivial - just add
: YourBaseClass
To the type. Likewise interfaces, noting ctrl+. to resolve namespaces automatically. Right-Click on the interface name to add the interface methods.
Re overrides; type override
and it gives you a list of overrides left. Selecting one then tab provides the signature and a default implementation.
So essentially, all these features are now in the editor - available all the time rather than just when adding the class.
When you open a C++ Project, there you'll have the Class Wizard. In a C# Project i didn't ever see such a wizard. I creat my classes with Shift+Alt+C
You still have the Wizards, maybe a bit different than what you are looking for. I'll add the steps shortly.
Okay, somewhat of a let-down as this doesn't include all of the inheritance features you described. This is how I've displayed the 'Wizard':
or ...
and gasp ...
Hhmmm ... not exactly a head turner.
I cannot find anything specifically as a Visual Studio add on yet. It would be nice to have something that would auto-generate some of that recursive code. I think that may be what the point of VS Templates are - although not as dynamic as a wizard would be.
[Edit] @Marc Gravell is right: the functions of the wizard are replaced by Intelli-Sense. I do think that even with Intelli-Sense, it would be nice to have the New Type Generator include options for inheritance, selecting public static as in a 'checked' listbox rather than a single descriptor. It is a bit lack-luster and I would probably use it if it provided more flexibility. While Intelli-Sense does replace the need for a wizard, I believe it would have been better to keep the old (but improved) Type Generator to reduce confusion.[/]
精彩评论