Пример #1
0
        private async void InitialServers()
        {
            await Task.Delay(500);

            var servers = GetConfig();

            foreach (var s in servers)
            {
                ViewModel.ServerViewModel serverVm = new ViewModel.ServerViewModel()
                {
                    Server = s
                };
                Servers.Add(serverVm);
            }
        }
Пример #2
0
        private void addserver_Click(object sender, RoutedEventArgs e)
        {
            ServerWindow serverWindow = new CSManager.ServerWindow();

            serverWindow.ShowDialog();
            var s = (Models.ServerModel)serverWindow.ServerModel;

            if (s == null)
            {
                return;
            }
            var server    = (Models.ServerModel)s.Clone();
            var newserver = new ViewModel.ServerViewModel()
            {
                Server = server
            };

            Servers.Add(newserver);
            SetConfig();
        }