public DefaultClientListener( ILogger logger, IAlarmState alarmState, IWasListener wasListener, ICoreObjectFactory coreObjectFactory) { this.mLogger = logger; // Function that returns all active alarms Func <List <Alarm> > getAlarmList = () => { return(alarmState.Alarms); }; // Function that returns the current WAS-connection state Func <bool> getWasState = () => { return(wasListener.HasConnectionEstablished); }; this.mGetAlarmList = getAlarmList; this.mGetWasConnectionState = getWasState; this.mCoreObjectFactory = coreObjectFactory; this.mTcpListener = this.mCoreObjectFactory.CreateTcpListener(AicSettings.Global.NetworkServiceIp, AicSettings.Global.NetworkServicePort); }
public DefaultListeningManager(ILogger logger, IAlarmState alarmState, IWasListener wasListener, IClientListener clientListener, IPing ping) { this.mLogger = logger; this.mAlarmState = alarmState; this.mWasListener = wasListener; this.mClientListener = clientListener; this.mPing = ping; TaskScheduler.UnobservedTaskException += (object sender, UnobservedTaskExceptionEventArgs ex) => { this.mLogger.LogError("(ListeningManager/Constructor/UnobservedTaskException)", ErrorType.ListeningManager_UnobservedTaskException, ex.Exception); }; }
public DefaultListeningManager(params INinjectModule[] modules) { using (StandardKernel kernel = new StandardKernel(modules)) { this.mLogger = kernel.Get <ILogger>(); this.mAlarmState = kernel.Get <IAlarmState>(); this.mWasListener = kernel.Get <IWasListener>(); this.mClientListener = kernel.Get <IClientListener>(); this.mPing = kernel.Get <IPing>(); } TaskScheduler.UnobservedTaskException += (object sender, UnobservedTaskExceptionEventArgs ex) => { this.mLogger.LogError("(ListeningManager/Constructor/UnobservedTaskException)", ErrorType.ListeningManager_UnobservedTaskException, ex.Exception); }; }