//@Brief Obtiene la información de la existencia de una actualización disponible //@Return dc_InfoUpdateSoftware Información de la actualización public dc_InfoUpdateSoftware CheckUpdate() { dc_InfoUpdateSoftware infoUpdate = new dc_InfoUpdateSoftware(); infoUpdate.stationControllerSwAvailable = false; infoUpdate.remoteManagerSwAvailable = false; try { m_mutexHostControllerEndpoints.WaitOne(); foreach (EndpointAddress ep in m_hostControllerEndpoints) { BasicHttpBinding binding = new BasicHttpBinding(BasicHttpSecurityMode.None); JBCHostControllerServiceClient serviceClient = new JBCHostControllerServiceClient(binding, ep); serviceClient.Open(); infoUpdate = serviceClient.CheckUpdate(); serviceClient.Close(); } } catch (Exception ex) { LoggerModule.logger.Error(System.Reflection.MethodInfo.GetCurrentMethod().Name + ". Error: " + ex.Message); } finally { m_mutexHostControllerEndpoints.ReleaseMutex(); } return(infoUpdate); }
private void AutomaticCheckUpdate() { bool bContinue = true; while (bContinue) { dc_InfoCheckPeriodicTime infoCheckPeriodic = m_comHostController.GetCheckPeriodicTime(); if (infoCheckPeriodic.available) { dc_InfoUpdateSoftware infoUpdate = m_comHostController.CheckUpdate(); if (infoUpdate.stationControllerSwAvailable || infoUpdate.remoteManagerSwAvailable || infoUpdate.hostControllerSwAvailable || infoUpdate.webManagerSwAvailable) { //Only raise event once bContinue = false; if (UpdateAvailableEvent != null) { UpdateAvailableEvent(); } } } Thread.Sleep(TIME_CHECK_UPDATE); } }