What are the default ContinueWith values
MSDN does not explicitly state this, but usually all other parameters are "default" when a method is overloaded. Let's find this method in the .NET source :
public Task ContinueWith(Action<Task, Object> continuationAction)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return ContinueWith(continuationAction, TaskScheduler.Current, default(CancellationToken), TaskContinuationOptions.None, ref stackMark);
}
So, by default CancellationToken
(that is CancellationToken.None
), empty TaskContinuationOptions
and current TaskScheduler
.
source to share
You can view most of the .Net source code at http://referencesource.microsoft.com/ . In your case, the exact overload of ( ContinueWith(Action<Task> continuationAction)
) looks like this:
public Task ContinueWith(Action<Task> continuationAction)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return ContinueWith(continuationAction, TaskScheduler.Current, default(CancellationToken), TaskContinuationOptions.None, ref stackMark);
}
So for CancellationToken
it default(CancellationToken)
, which is equivalent CancellationToken.None
.
For TaskContinuationOptions
it TaskContinuationOptions.None
.
For TaskScheduler
itTaskScheduler.Current
source to share