Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# event subscription in Visual Studio 2010

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?

like image 944
Entity Avatar asked Apr 21 '11 12:04

Entity


1 Answers

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

like image 135
Teoman Soygul Avatar answered Sep 23 '22 13:09

Teoman Soygul