CodeContainerStorageManager.SubscribeAsync 方法

定义

允许 targetBlock 接收有关 Shell 访问的代码容器的更新。

public System.Threading.Tasks.Task<IDisposable> SubscribeAsync (System.Threading.Tasks.Dataflow.ITargetBlock<Microsoft.VisualStudio.Shell.StatefulReadOnlyList<Microsoft.VisualStudio.Shell.CodeContainerManagement.CodeContainer,Nullable<int>>> targetBlock, System.Threading.CancellationToken cancellationToken = default);
abstract member SubscribeAsync : System.Threading.Tasks.Dataflow.ITargetBlock<Microsoft.VisualStudio.Shell.StatefulReadOnlyList<Microsoft.VisualStudio.Shell.CodeContainerManagement.CodeContainer, Nullable<int>>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<IDisposable>
override this.SubscribeAsync : System.Threading.Tasks.Dataflow.ITargetBlock<Microsoft.VisualStudio.Shell.StatefulReadOnlyList<Microsoft.VisualStudio.Shell.CodeContainerManagement.CodeContainer, Nullable<int>>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<IDisposable>
Public Function SubscribeAsync (targetBlock As ITargetBlock(Of StatefulReadOnlyList(Of CodeContainer, Nullable(Of Integer))), Optional cancellationToken As CancellationToken = Nothing) As Task(Of IDisposable)

参数

targetBlock
ITargetBlock<StatefulReadOnlyList<CodeContainer,Nullable<Int32>>>

要将更新发送到的目标块。

cancellationToken
CancellationToken

取消令牌

返回

Task<IDisposable>

一个 IDisposable ,它 targetBlock 在处置时取消订阅。

实现

例外

如果为 null,则引发 targetBlock

适用于