If you want to control the invocation order more closely—if you want guaranteed invocation, for example—you can get the invocation list from the delegate and invoke the functions yourself. Here's what that would look like: foreach (LogHandler logHandler in lh.GetInvocationList()) { try { logHandler(message); } catch (Exception e) { // do something with the exception here… } } Delegates on MSDN. Events und Delegates GUTE Beschreibung Unterschied, Vorteil Events usw...
Latest Posts
Popular Posts
-
I am *very* keen on automating tests, so I was looking into unit testing a WCF service. If I say "unit test", I mean a fast ,...
-
It's easy I thought, just select the Property of the EntityType and set the Default Value in the Properties window to: DateTime.Now ...
-
Had some discussions about Lists and controls, like Listbox and Listview, and sometimes its difficult to distinguish those. System.Win...
No comments:
Post a Comment