예제 #1
0
 public ServiceBase(TaskScheduler taskScheduler = null)
 {
     _scheduler    = taskScheduler ?? TaskScheduler.Default;
     _runner       = _scheduler.ToContextRunner();
     _initLazy     = new AsyncLazyInit(_init);
     _shutDownLazy = new AsyncLazyInit(_shutDown);
 }
예제 #2
0
 public ContextAction(AsyncContextRunner contextRunner, object owner, Action <T> action)
     : this(contextRunner, action.ToWeak(owner))
 {
 }
예제 #3
0
 public ContextAction(AsyncContextRunner contextRunner, WeakAction <T> wa)
 {
     WeakAction    = wa;
     ContextRunner = contextRunner;
 }
예제 #4
0
 public ContextFunc(AsyncContextRunner contextRunner, object owner, Func <TResult> action)
     : this(contextRunner, action.ToWeak(owner))
 {
 }
예제 #5
0
 public ContextFunc(AsyncContextRunner contextRunner, WeakFunc <TResult> wa)
 {
     WeakFunc      = wa;
     ContextRunner = contextRunner;
 }
예제 #6
0
 public ContextMulticastAction Add(WeakAction wa, AsyncContextRunner runner)
 {
     return(new ContextMulticastAction(_actions.Concat(wa.InContext(runner))));
 }
예제 #7
0
 public ContextMulticastFuncTask <T> Add(AsyncContextRunner runner, WeakFunc <T, Task> wa)
 {
     return(new ContextMulticastFuncTask <T>(_actions.Concat(wa.InContext(runner))));
 }
예제 #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));
 }
예제 #9
0
파일: Tasks.cs 프로젝트: kobi2294/MvvmKit
 public static AsyncContextRunner ToContextRunner(this TaskScheduler scheduler)
 {
     return(AsyncContextRunner.For(scheduler));
 }
예제 #10
0
 public static ContextAction <T1, T2> InContext <T1, T2>(this WeakAction <T1, T2> wa, AsyncContextRunner context)
 {
     return(new ContextAction <T1, T2>(context, wa));
 }
예제 #11
0
 public static ContextAction InContext(this Action a, object owner, AsyncContextRunner context)
 {
     return(new ContextAction(context, owner, a));
 }
예제 #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));
 }
예제 #13
0
 public static ContextFunc <T, TRes> InContext <T, TRes>(this WeakFunc <T, TRes> wa, AsyncContextRunner context)
 {
     return(new ContextFunc <T, TRes>(context, wa));
 }
예제 #14
0
 public static ContextAction InContext(this WeakAction wa, AsyncContextRunner context)
 {
     return(new ContextAction(context, wa));
 }