Exemplo n.º 1
0
 public static void Using(this IBusyState state, Action execute)
 {
     using (state.Begin())
     {
         execute();
     }
 }
Exemplo n.º 2
0
 public static async Task UsingAsync(this IBusyState state, Func <Task> execute)
 {
     using (state.Begin())
     {
         await execute().ConfigureAwait(true);
     }
 }
Exemplo n.º 3
0
 public static async Task <TResult> UsingAsync <TResult>(this IBusyState state, Func <Task <TResult> > execute)
 {
     using (state.Begin())
     {
         return(await execute().ConfigureAwait(true));
     }
 }
Exemplo n.º 4
0
 public static TResult Using <TResult>(this IBusyState state, Func <TResult> execute)
 {
     using (state.Begin())
     {
         return(execute());
     }
 }