Exemplo n.º 1
0
 private void RegisterWithSource(CancellationSource source)
 {
     if (source == null)
     {
         return; //todo: throw?
     }
     source.Register(Cancel);
 }
Exemplo n.º 2
0
 public void Register(Action callback)
 {
     if (!CanBeCanceled)
     {
         throw new Exception("Non cancellable token will never fire");
     }
     _source.Register(callback);
 }