CodeContainerStorageManager.SubscribeAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
允许 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
取消令牌
返回
一个 IDisposable ,它 targetBlock 在处置时取消订阅。
实现
例外
如果为 null,则引发 targetBlock 。