6

So, in visual studio, if you type something like this:

retryExecutor.Retrying += 

Then a little tooltip thing pops up saying that you can press TAB to turn it into this:

retryExecutor.Retrying+= new EventHandler(retryExecutor_Retrying);

Then if you press TAB again, it generates:

void retryExecutor_Retrying(object sender, EventArgs e)
{
    throw new NotImplementedException();
}

Of course, this is very useful. But I find myself more often needing a construction like so:

retryExecutor.Retrying += (o, e) =>
{

};

So, is there anyway to add a new shortcut, or at least change the functionality of pressing TAB?

2
  • 1
    Why do you prefer inline methods to ones that are explicitly defined in the source file as a matter of general course? I certainly understand that they are useful sometimes, but it strikes me as strange that you generally use the latter more often than the former. Commented Apr 21, 2011 at 12:35
  • Well, if possible, I try to use the explicitly defined ones. But in the type of coding I usually do, I find it necessary to use inline methods. Sometimes, its just cleaner to do it this way too, e.g. if there's just one statement you want to make. Commented Apr 21, 2011 at 12:39

1 Answer 1

2

You can always crate and use IntelliSense code snipppets. Read more about it here: http://msdn.microsoft.com/en-us/library/ms165392%28v=VS.100%29.aspx

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.