This page in the MS documentation,覆盖异步在Windows窗体应用程序,规定:每个BeginInvoke都必须跟一个EndInvoke吗?
您可以调用EndInvoke如果neccesary从委托检索的返回值,但这不是必需的。(强调)
This page covering the general case of asynchronous delegates,规定不同的东西:
不管你使用哪种技术,总是调用EndInvoke来完成你的异步调用。
这两个似乎是直接冲突。
这是真的吗?有人可以解释吗?
另请参阅a post by Phil Haack。
相关:Is EndInvoke optional, sort-of optional, definitely not optional?
我同意你的大部分答案,除了评论他们是“不同的电话”。他们似乎并不是完全不同的电话。他们是不是都在讨论异端代表的EndInvoke?只是控制代理上的EndInvoke是一个特例。 – Cheeso 2009-08-13 22:37:06
@Cheeso:否 - Control.BeginInvoke根本不是*委托上的调用*。它*需要*代表。 – 2009-08-13 22:41:40