Ejemplo n.º 1
0
        public void Init(ClientType clientType)
        {
            IAutomationIDGeneratorDuplexCallback callback = OperationContext.Current.GetCallbackChannel <IAutomationIDGeneratorDuplexCallback>();

            if (this.m_Clients.FirstOrDefault(q => q.Callback == callback) == null)
            {
                this.m_Clients.Add(new ClientInfo(clientType, callback));
                this.SendMessageToClients($"Client connected: {clientType}");
            }
        }
Ejemplo n.º 2
0
        public void Close(ClientType clientType)
        {
            IAutomationIDGeneratorDuplexCallback callback = OperationContext.Current.GetCallbackChannel <IAutomationIDGeneratorDuplexCallback>();

            ClientInfo client = m_Clients.FirstOrDefault(q => q.Callback == callback);

            if (client != null)
            {
                this.m_Clients.Remove(client);
                this.SendMessageToClients($"Client diconnected: {clientType}");
            }
        }
Ejemplo n.º 3
0
 public ClientInfo(ClientType clientType, IAutomationIDGeneratorDuplexCallback callback)
 {
     ClientType = clientType;
     Callback   = callback;
 }