private void ListenForSources() { HostDiscovery sourceDiscovery = new HostDiscovery(typeof(ITipManager), new TimeSpan(0, 0, 0, 1, 0)); while (!m_Shutdown) { Collection <EndpointDiscoveryMetadata> sourceEndpoints = sourceDiscovery.GetAvailableConnections(); if (sourceEndpoints.Count > 0) { for (Int32 index = 0; index < sourceEndpoints.Count; index++) { String alias = GetAlias(sourceEndpoints[index].Extensions); if (!String.IsNullOrWhiteSpace(alias)) { if (!ContainsClient(alias)) { TIPClient tipManager = new TIPClient(alias, CTICaseDirectory, FTIImageDirectory, m_CTITemplateDirectory, m_WSServer); InstanceContext sourceCallback = new InstanceContext(tipManager); ServiceEndpoint tipManagerEndPoint = new ServiceEndpoint(ContractDescription.GetContract(typeof(TipManagerEndpoint)), new TCPBinding(), sourceEndpoints[index].Address); tipManager.EndPoint = new TipManagerEndpoint(sourceCallback, tipManagerEndPoint); m_TIPManagers.Add(tipManager); } } } } } }
public void RemoveCTICaseAssignment(string caseId) { TIPClient tipClient = FindClientByCTICase(caseId); if (tipClient != null) { tipClient.RemoveCTICaseAssignment(caseId); } }
public void AssignCTICase(string caseId, string workstationId) { TIPClient tipClient = FindClientByCTICase(caseId); if (tipClient != null) { tipClient.AssignCTICase(caseId, workstationId); } }
private TIPClient FindClientByWorkstationId(string workstationId) { TIPClient ret = null; foreach (TIPClient tipManager in m_TIPManagers) { if (tipManager.ContainsWorkstation(workstationId)) { ret = tipManager; break; } } return(ret); }
private TIPClient FindClientByCTICase(string caseId) { TIPClient ret = null; foreach (TIPClient tipManager in m_TIPManagers) { if (tipManager.ContainsCTICase(caseId)) { ret = tipManager; break; } } return(ret); }
private TIPClient FindClientByFTIFile(string filename) { TIPClient ret = null; foreach (TIPClient tipManager in m_TIPManagers) { if (tipManager.ContainsFTIFile(filename)) { ret = tipManager; break; } } return(ret); }
public void TipResult(WorkstationResult workstationResult) { TIPClient tipClient = FindClientByWorkstationId(workstationResult.WorkstationId); try { if (tipClient != null) { tipClient.TipResult(workstationResult); } } catch (Exception) { tipClient.Dispose(); m_TIPManagers.Remove(tipClient); } }
public void ProcessedCase(string caseId) { for (int index = 0; index < m_TIPManagers.Count; index++) { TIPClient tipClient = m_TIPManagers[index]; try { tipClient.ProcessedCase(caseId); } catch (Exception) { tipClient.Dispose(); m_TIPManagers.Remove(tipClient); } } }
private void ListenForSources() { HostDiscovery sourceDiscovery = new HostDiscovery(typeof(ITipManager), new TimeSpan(0, 0, 0, 1, 0)); while (!m_Shutdown) { Collection<EndpointDiscoveryMetadata> sourceEndpoints = sourceDiscovery.GetAvailableConnections(); if (sourceEndpoints.Count > 0) { for (Int32 index = 0; index < sourceEndpoints.Count; index++) { String alias = GetAlias(sourceEndpoints[index].Extensions); if (!String.IsNullOrWhiteSpace(alias)) { if (!ContainsClient(alias)) { TIPClient tipManager = new TIPClient(alias, CTICaseDirectory, FTIImageDirectory, m_CTITemplateDirectory, m_WSServer); InstanceContext sourceCallback = new InstanceContext(tipManager); ServiceEndpoint tipManagerEndPoint = new ServiceEndpoint(ContractDescription.GetContract(typeof(TipManagerEndpoint)), new TCPBinding(), sourceEndpoints[index].Address); tipManager.EndPoint = new TipManagerEndpoint(sourceCallback, tipManagerEndPoint); m_TIPManagers.Add(tipManager); } } } } } }