Exemplo n.º 1
0
 public ServiceBase(TaskScheduler taskScheduler = null)
 {
     _scheduler    = taskScheduler ?? TaskScheduler.Default;
     _runner       = _scheduler.ToContextRunner();
     _initLazy     = new AsyncLazyInit(_init);
     _shutDownLazy = new AsyncLazyInit(_shutDown);
 }
Exemplo n.º 2
0
 public ContextAction(AsyncContextRunner contextRunner, object owner, Action <T> action)
     : this(contextRunner, action.ToWeak(owner))
 {
 }
Exemplo n.º 3
0
 public ContextAction(AsyncContextRunner contextRunner, WeakAction <T> wa)
 {
     WeakAction    = wa;
     ContextRunner = contextRunner;
 }
Exemplo n.º 4
0
 public ContextFunc(AsyncContextRunner contextRunner, object owner, Func <TResult> action)
     : this(contextRunner, action.ToWeak(owner))
 {
 }
Exemplo n.º 5
0
 public ContextFunc(AsyncContextRunner contextRunner, WeakFunc <TResult> wa)
 {
     WeakFunc      = wa;
     ContextRunner = contextRunner;
 }
Exemplo n.º 6
0
 public ContextMulticastAction Add(WeakAction wa, AsyncContextRunner runner)
 {
     return(new ContextMulticastAction(_actions.Concat(wa.InContext(runner))));
 }
Exemplo n.º 7
0
 public ContextMulticastFuncTask <T> Add(AsyncContextRunner runner, WeakFunc <T, Task> wa)
 {
     return(new ContextMulticastFuncTask <T>(_actions.Concat(wa.InContext(runner))));
 }
Exemplo n.º 8
0
 public static ContextAction <T1, T2> InContext <T1, T2>(this Action <T1, T2> a, object owner, AsyncContextRunner context)
 {
     return(new ContextAction <T1, T2>(context, owner, a));
 }
Exemplo n.º 9
0
 public static AsyncContextRunner ToContextRunner(this TaskScheduler scheduler)
 {
     return(AsyncContextRunner.For(scheduler));
 }
Exemplo n.º 10
0
 public static ContextAction <T1, T2> InContext <T1, T2>(this WeakAction <T1, T2> wa, AsyncContextRunner context)
 {
     return(new ContextAction <T1, T2>(context, wa));
 }
Exemplo n.º 11
0
 public static ContextAction InContext(this Action a, object owner, AsyncContextRunner context)
 {
     return(new ContextAction(context, owner, a));
 }
Exemplo n.º 12
0
 public static ContextFunc <T, TRes> InContext <T, TRes>(this Func <T, TRes> a, AsyncContextRunner context, object owner)
 {
     return(new ContextFunc <T, TRes>(context, owner, a));
 }
Exemplo n.º 13
0
 public static ContextFunc <T, TRes> InContext <T, TRes>(this WeakFunc <T, TRes> wa, AsyncContextRunner context)
 {
     return(new ContextFunc <T, TRes>(context, wa));
 }
Exemplo n.º 14
0
 public static ContextAction InContext(this WeakAction wa, AsyncContextRunner context)
 {
     return(new ContextAction(context, wa));
 }