Subscribing to C # Events in Visual Studio 2010

So, in the visual studio, if you introduce something like this:

retryExecutor.Retrying += 

Then a little hint appears saying that you can press TAB to include it in 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 in need of such a design:

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

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

+6
source share
1 answer

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

+2
source

Source: https://habr.com/ru/post/886394/


All Articles