Ejemplo n.º 1
0
 static void Work(RulyCanceler c)
 {
     while (true)
     {
         c.ThrowIfCancellationRequested();
         // ...
         try
         {
             OtherMethod(c);
         }
         finally { /* any required cleanup */ }
     }
 }
Ejemplo n.º 2
0
 static void OtherMethod(RulyCanceler c)
 {
     Console.WriteLine("Other Method Called");
     c.ThrowIfCancellationRequested();
 }