Exemple #1
0
 private void OnCheckFcsConnection(object sender, System.Timers.ElapsedEventArgs args)
 {
     if (fcsService.IsConnected == false)
     {
         log.Info("App: Attempting to re-establish connection to Fcs");
         fcsService.ConnectAsync(appSettings.FcsIpAddress, appSettings.FcsPort);
         fcstimer.Enabled = true;
     }
 }
Exemple #2
0
        private void ConfigureFcsServer()
        {
            log.Debug("App: Configuring fcs...");
            fcsService = Mvx.IoCProvider.Resolve <IFcsService>();
            fcsService.ConnectionStatusChanged       += OnFcsConnectionStatusChanged;
            fcsService.FcsReceivedConfigurationEvent += OnFCSConfigReceived;
            fcsService.FcsReceivedBasketEvent        += OnBasketReceived;

            fcstimer = new System.Timers.Timer(2000)
            {
                AutoReset = false
            };

            fcstimer.Elapsed += OnCheckFcsConnection;

            log.Info("App: Attempting to establish connection to Fcs");
            fcsService.ConnectAsync(appSettings.FcsIpAddress, appSettings.FcsPort);
            if (!fcsService.IsConnected)
            {
                fcstimer.Enabled = true;
            }
        }