private void RefreshServers() { Application.Current.Dispatcher.BeginInvoke(() => { ServerCollection.Clear(); foreach (var server in _vtubeMonServerConnection.Servers) { ServerCollection.Add(new ServerViewModel(server)); } }); }
public void ReadConfig(Configuration config) { ServerCollection.Clear(); foreach (var server in config.configs) { ServerCollection.Add(server); } if (config.index >= 0 && config.index < ServerCollection.Count) { SelectedServer = ServerCollection[config.index]; } ServerCollection.CollectionChanged -= ServerCollection_CollectionChanged; ServerCollection.CollectionChanged += ServerCollection_CollectionChanged; }
public void ReadConfig(Configuration config) { ServerCollection.Clear(); foreach (var server in config.configs) { var serverObject = ServerObject.CopyFromServer(server); serverObject.Enable = server.enable; serverObject.Protocoldata = server.getProtocolData(); serverObject.Obfsdata = server.getObfsData(); ServerCollection.Add(serverObject); } if (config.index >= 0 && config.index < ServerCollection.Count) { SelectedServer = ServerCollection[config.index]; } }