private FakeIVsTask( FakeIVsTask parent, __VSTASKRUNCONTEXT context, __VSTASKCONTINUATIONOPTIONS options, IVsTaskBody body, object asyncState) { TaskScheduler scheduler = GetSchedulerFromContext(context); TaskContinuationOptions continuationOptions = GetTaskContinuationOptions(options); _t = parent._t.ContinueWith( (task, state) => { body.DoWork(this, 1, new IVsTask[] { parent }, out object result); return(result); }, asyncState, default(CancellationToken), continuationOptions, scheduler); parent.OnMarkedAsBlocking?.Invoke(parent, new BlockingTaskEventArgs(parent, this)); }
private FakeIVsTaskCompletionSource(TaskCompletionSource <object> source) { _source = source; Task = new FakeIVsTask(_source.Task); }
/// <summary>Gets the task scheduler instance used for the context specified. This returnc a <see cref="T:System.Threading.Tasks.TaskScheduler" /> type. The functionality in this method is intended to be exposed by helper classes in MPF and not to be directly consumed by users.</summary> /// <param name="context">The context.</param> /// <returns>The HRESULT.</returns> public object GetTaskScheduler(uint context) => FakeIVsTask.GetSchedulerFromContext((__VSTASKRUNCONTEXT)context);