private void OnClientInfoChanged(object sender, WcfClientInfo clientInfo) { WcfClientInfo clone = clientInfo.Clone(); lock (_receivedClientInfos) { _receivedClientInfos.Add(clone); } }
public bool Match(WcfClientInfo clientInfo, ServiceConfiguration sericeConfiguration) { var minServerVersion = Version.Parse(clientInfo.MinServerVersion); var serverVersion = Version.Parse(sericeConfiguration.ServerVersion); var minClientVersion = Version.Parse(sericeConfiguration.MinClientVersion); var clientVersion = Version.Parse(clientInfo.ClientVersion); return(minServerVersion <= serverVersion && minClientVersion <= clientVersion); }
public void UpdateModel(WcfClientInfo clientInfo) { Model = clientInfo; if (Version.TryParse(Model.ServerVersion, out var serverVersion)) { MinClientVersion = $"{serverVersion.Major}.0.0"; } NotifyOfPropertyChange(nameof(Service)); NotifyOfPropertyChange(nameof(Uri)); NotifyOfPropertyChange(nameof(ServerVersion)); NotifyOfPropertyChange(nameof(ClientVersion)); NotifyOfPropertyChange(nameof(MinServerVersion)); NotifyOfPropertyChange(nameof(MinClientVersion)); NotifyOfPropertyChange(nameof(State)); NotifyOfPropertyChange(nameof(Tries)); NotifyOfPropertyChange(nameof(StateBrush)); }
/// <summary> /// Updates the client information. /// </summary> private void UpdateClientInfo(WcfClientInfo clientInfo) { var clientVm = Clients.FirstOrDefault(c => c.Source == clientInfo); var index = 0; if (clientVm != null) { index = Clients.IndexOf(clientVm); } if (index >= 0) { Clients.RemoveAt(index); if (clientInfo.State != ConnectionState.Closed) { Clients.Insert(index, new WcfClientInfoViewModel(clientInfo)); } } else { Clients.Add(new WcfClientInfoViewModel(clientInfo)); } }
public WcfClientInfoViewModel(WcfClientInfo source) { Source = source; }
/// <summary> /// Called when [client information changed]. /// </summary> private void OnClientInfoChanged(object sender, WcfClientInfo client) { Execute.OnUIThread(() => UpdateClientInfo(client)); }
public WcfClientInfoViewModel(WcfClientInfo source) { UpdateModel(source); }