Exemplo n.º 1
0
        public async Task OperateAsync(ComplexTypeWithCancellationToken complexType)
        {
            Cancellation = complexType.CancellationToken;

            using (Cancellation.Register(() => TaskCompletionSource.TrySetCanceled(Cancellation)))
            {
                await(TaskCompletionSource?.Task ?? Task.CompletedTask);
            }
        }