c# method, event wizard
Hi,
am starting to work my way through a tutorial book, trying to learn C#. It
tells me to run the C# Method Wizard, by right-clicking an existing Class in
Class View and selecting Add > Add Method.
There is no Add option in Visual Studio 2005 (which I am using).
I have looked around for about an hour trying to locate the Method Wizard,
but the help does not tell me anything more than it is there.
Has this been rtemoved from Studio 2005? If not, how do I access it? Not
being able to find it is making following the tutorial very difficult.
Thanks in advance
ityu
[613 byte] By [
ityu] at [2007-12-24]
Ityu,
This wizard has been removed from VS 2005. We decided to remove the wizards for a few reasons:
- It's generally only useful for learning the language (of course, that's what you're trying to do, so in this case it would have helped); therefore it's unlikely to have a lot of reuse value. Several of the wizards seemed like an overkill, making it more difficult to learn the language instead of easier (for example, there was an add field wizard).
- The wizard was a combination of HTML and JScript (all the rage when it was authored in '99), but unfortunately it made it very difficult to maintain.
- Due to the infrastructure, it would have been extremely costly to enhance the functionality of the wizards to do more reusable things or interesting things. For example, allowing for more natural typing and hosting of the IntelliSense engine.
- We received very few comments about the wizards from the community (even after we removed them), so we made the assumption that our conjecture about them being used infrequently was correct. We did not have insturmented data at the time as we do today for many things in VS 2005, so we relied on anecdotal data.
- We tried to incorporate the wizards that we considered to be the most valuable directly into the editor; for example, implement interface was a wizard in VS 2002 (and in VS 2003), but in 2003 it's also available directly in the editor which made it significantly more discoverable.
Which parts of the tutorial do you have questions on? I can explain how the wizards worked and the general form of the code that they would generate.
Anson
Anson,
Well then you could have also had all references removed from the documentation!!!
I just spent an hour trying to get that wizard to pop up and add a 'method' for me. I didn't.
I was thinking "I must be doing something wrong".
Now really... the Help at http://msdn2.microsoft.com/en-us/library/aa288385(VS.71).aspx goes on and on about using these, and now you tell me you decided to remove them!
I can only hope the rest of the product is done more thoroughly and completely,
or maybe is there somewhere an 'errata' sheet about what items in the online help no longer apply?
Jay
Jay,
Unfortunatley the same documentation is used to support both VS 2003 and VS 2002. They exist in VS 2002 and not in VS 2003. However, you are correct that the individual topics should mention that they do not apply to VS 2003. I'm sorry that you ended up wasting an hour because of the incorrect documentation.
Anson
Martin,
There is a feature in VS 2005 called code snippets. Basically you type a 'shortcut' word into the editor and then hit tab. The shortcut expands into its associated text with a few fields that need to be filled in. There is one for a property called 'prop. Simply type prop and then tab (you may need to hit tab twice depending on your IntelliSense settings).
If you cannot get that to work, the syntax for a property is as follows:
class Employee
{
private string name; public string Name { get { return name; } set { name = value; } }
}
The property, Name in this case, willl return the value of the "name" field. It will also set the value in an assignment (e.Name = "PropertyMan").
Anson