Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
208 views
in Technique[技术] by (71.8m points)

c# - Difference between Delegate.Invoke and Delegate()

delegate void DelegateTest();

DelegateTest delTest;

Whats the difference between calling delTest.Invoke() and delTest()? Both would execute the delegate on the current thread, right?

question from:https://stackoverflow.com/questions/1367070/difference-between-delegate-invoke-and-delegate

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The delTest() form is a compiler helper, underneath it is really a call to Invoke().


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...