Entity
Entity

Reputation: 8202

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?

Upvotes: 6

Views: 287

Answers (1)

Teoman Soygul
Teoman Soygul

Reputation: 25732

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

Upvotes: 2

Related Questions