예제 #1
0
 private void RefreshServers()
 {
     Application.Current.Dispatcher.BeginInvoke(() =>
     {
         ServerCollection.Clear();
         foreach (var server in _vtubeMonServerConnection.Servers)
         {
             ServerCollection.Add(new ServerViewModel(server));
         }
     });
 }
예제 #2
0
        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];
            }
        }