Пример #1
0
 public void CanChainTasksWithoutEndWithAndThrowException()
 {
     using (var c = new ChainedOperation())
     {
         c.BeginWith(First) // first action
             .Then(Second) // second action
             .Then(Third) // third action
             .Then(Fourth); // fourth action
     }
 }
Пример #2
0
 public void CanChainTasks()
 {
     using (var c = new ChainedOperation())
     {
         c.BeginWith(First) // first action
             .Then(Second) // second action
             .Then(Third) // third action
             .Then(Fourth) // fourth action
             .EndWith(e =>
             {
                 if (e != null)
                 {
                     Trace.TraceError("An exception ocurred!");
                 }
             });
     }
 }