Ejemplo n.º 1
0
 public static IDisposable SubscribeToSignal <TState1, TState2>(
     this ITrigger trigger,
     Action <ITriggerSignalProperties, IDisposable, TState1, TState2> onSignal,
     TState1 state1,
     TState2 state2,
     IUnhandledExceptionObserver exceptionObserver = default)
 {
     //
     onSignal.EnsureNotNull(nameof(onSignal));
     //
     return
         (new P_SignalSubscription <Tuple <TState1, TState2> >(
              trigger: trigger,
              unhandledExceptionObserver: exceptionObserver ?? UnhandledExceptionObserverOption.Require(),
              onSignal: (locSignalProps, locSubscription, locState) => onSignal(locSignalProps, locSubscription, locState.Item1, locState.Item2),
              state: Tuple(state1, state2)));
 }
Ejemplo n.º 2
0
 void P_CtorInitializer(IUnhandledExceptionObserver unhandledExceptionObserver = default)
 {
     _unhandledExceptionObserver = unhandledExceptionObserver ?? UnhandledExceptionObserverOption.Require();
     _runControl = new RunControl <XAppContainerControl>(options: RunControlOptions.SingleStart, component: this, start: DoStartAsync, stop: DoShutdownAsync);
 }
Ejemplo n.º 3
0
 public static IDisposable SubscribeToSignal <TState>(this ITrigger trigger, Action <ITriggerSignalProperties, IDisposable, TState> onSignal, TState state, IUnhandledExceptionObserver exceptionObserver = default)
 => new P_SignalSubscription <TState>(trigger: trigger, unhandledExceptionObserver: exceptionObserver ?? UnhandledExceptionObserverOption.Require(), onSignal: onSignal, state: state);