.


:




:

































 

 

 

 


Public void ThrowIfCancellationRequested()




, , , OperationCanceledException. . , . , AggregateException, InnerException InnerExceptions. ( InnerExceptions . 25.)

, CancellationTokenSource, System. Threading. , CancellationTokenSource. ( CancellationTokenSource.) , , Token, .

public CancellationToken Token { get; }

, .

. : , . , . IsCancellationRequested . true, , , . , . , , IsCancellationRequested , .

, ThrowIfCancellationRequested (), , , Task, StartNew (). . StartNew ().

public Task StartNew(Action<Object> action, Object ,

CancellationToken _)

, _. , , , Task. , Action.

public delegate void Actioncin T>(T obj)

Object. obj Cancel lationToken.

: , Dispose ().

. : IsCanceled Task. true, .

. . , ThrowIfCancellationRequested () MyTask (). , . IsCancellationRequested. true, Cancel () , ThrowIfCancellationRequested () .

// .

Using System;

Using System.Threading;





:


: 2016-12-03; !; : 405 |


:

:

! . .
==> ...

1982 - | 1762 -


© 2015-2024 lektsii.org - -

: 0.009 .