Possible duplicate:MethodInvoker vs Action for Control.BeginInvoke
ThreadPool.QueueUserWorkItem(x => { //get dataset from web service BeginInvoke(new Action(() => { //fill grid })); BeginInvoke(new MethodInvoker(() => { //fill grid })); });
In C # 2.0, I used MethodInvoker highlighting to update the user interface from a background thread, would it make sense to switch to Action when used in BeginInvoke? Is it faster or safer to use an action?
, , . MethodInvoker WinForms . Action .
MethodInvoker
Action
( MSDN):
public delegate void MethodInvoker() public delegate void Action()
, IL . , . Action , MethodInvoker . , .
, , .
Source: https://habr.com/ru/post/1774334/More articles:Ruby string operation does not work with captured group - stringIs there an ACPrintFix (Flash Print Fix) implementation for Fusion Charts Free? - actionscriptHow does a webservice maintain a session when the client is a window / console application? - c #Store bitset in Engine application - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1774333/is-there-an-easy-way-for-users-to-print-flash-open-flash-charts-from-their-browser&usg=ALkJrhihZFi6IPS3TuO7Ww005mp-WFKsrgIs Jetty non-blocking by default? - nonblockingHow to pass through a container in another class? - c ++Difference between System.gc () and reclaiming dead objects made using heap dump in real time? - javaPerl: create a hash from an array - arraysSaving iPhone App after AppStore Approval for Beta - iphoneAll Articles