Example #1
0
        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));
        }
Example #2
0
 public static TaskContinuationOptions GetTaskContinuationOptions(__VSTASKCONTINUATIONOPTIONS vsTaskOptions) =>
 (TaskContinuationOptions)vsTaskOptions;