Jeff Key

It works on my machine

Sponsors

My Job

My stuff

Old stuff

Useful Stuff

Unheard wish fulfilled

Man oh man I can't wait to dig further into VS 2005 TP.  I only had a minute before work to very quickly check out a few things and noticed “Generate Method Stub” in the Refactoring menu.  Going on a hunch, I created an event handler for a dummy button on a form:

private void button3_Click(object sender, EventArgs e)
{
     string something = HelloMethod(sender);
}

HelloMethod didn't exist.  I put the cursor on the HelloMethod and selected Refactoring|Generate Method Stub and got the following:

private string HelloMethod(object sender)
{
    throw new NotImplementedException();
}

Are you kidding me?!?  Brilliant! 

  • It inferred the proper return type.
  • Properly named and typed the param.
  • Private visibility.
  • NotImplementedException by default.

I need this feature several times a day and I couldn't ask for a better implementation.  Thank you!

Comments

Darrell said:

Cool. I can't wait to get a hold of a copy for myself. Our MSDN sub is managed via another developer, so I can't download :(
# March 26, 2004 11:24 AM

JD said:

That's slick... I could use that several times a day. Wonder if there's a macro that would run under VS.NET 2003...[off to google...]
# March 26, 2004 7:57 PM

Jeff Key said:

Good thinking, JD. Any luck?
# March 27, 2004 1:14 PM

JD said:

No luck via Google and Google Groups, though I suppose it's possible I didn't use the right combination of search terms.

Now if only I knew the automation model better and could tackle the macro on my own. Maybe it's time to see how good the "Record Macro" works as a starting point.
# March 31, 2004 12:24 PM

Jeff Key said:

Bummer..thanks for the update. :)
# April 1, 2004 12:25 AM