简体   繁体   English

如何使用continueWith继续执行另一个任务?

[英]How do I use continueWith to continue a task with another task?

    Dim listOfTask = New List(Of Task)
    For Each account In uniqueAccounts().Values
        Dim newtask = account.conditionalInitializeAsync()
        Dim nexttask = account.getPairsPriceStepAsync()
        listOfTask.Add(newtask)
        listOfTask.Add(nexttask)
        Dim nexttaskaftenewtask = newtask.ContinueWith(nexttask) 'compiler warning
    Next

Instead of list 代替清单

        listOfTask.Add(newtask)
        listOfTask.Add(nexttask)

I want to do 我想要做

        listOfTask.Add(nexttaskaftenewtask )

How do I do so? 我该怎么做?

I can compile the following without error or warning. 我可以编译以下内容而不会出现错误或警告。 Hope this helps. 希望这可以帮助。

 Dim nexttaskaftenewtask = newtask.ContinueWith(New Action(Of Task)(Function() nexttask))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM