public void AddClient(ClientCredentials clientCredentials) { Dispatcher.BeginInvoke(new Action( delegate() { var connectionViewModel = new ClientViewModel(clientCredentials); Clients.Add(connectionViewModel); } )); }
public void AddClient(FiresecService.Service.FiresecService firesecService) { Dispatcher.BeginInvoke(new Action( delegate() { var endpointAddress = new EndpointAddress(new Uri(firesecService.ClientCredentials.ClientCallbackAddress)); var port = endpointAddress.Uri.Port; var connectionViewModel = new ClientViewModel() { FiresecService = firesecService, UID = firesecService.UID, UserName = firesecService.ClientCredentials.UserName, ClientType = firesecService.ClientCredentials.ClientType, IpAddress = firesecService.ClientIpAddressAndPort, CallbackPort = port, ConnectionDate = DateTime.Now }; Clients.Add(connectionViewModel); } )); }