Esempio n. 1
0
        private void AddServer(object sender, RoutedEventArgs e)
        {
            AddServer w = new AddServer(ini);

            w.ShowDialog();
            Load_Server();
        }
Esempio n. 2
0
        private void cmdAddServer_Click(object sender, RoutedEventArgs e)
        {
            var dialog = new AddServer();

            dialog.Owner = this;

            var result = dialog.ShowDialog();

            if (result == true)
            {
                ServerManager.AddNewServer(dialog.Server);
                PopulateServerLists();
            }
        }
Esempio n. 3
0
        private void cmdEditServer_Click(object sender, RoutedEventArgs e)
        {
            if (cboLauncherServerList.SelectedItem is Server server)
            {
                var dialog = new AddServer(server);
                dialog.Owner = this;

                var result = dialog.ShowDialog();

                if (result == true)
                {
                    ServerManager.SaveServerListToDisk();
                    PopulateServerLists();
                    SelectServer(server.Id);
                }
            }
        }
Esempio n. 4
0
        private void btnEditServers_Click(object sender, RoutedEventArgs e)
        {
            MainWindowDisable();

            EditServersViewModel vm  = new EditServersViewModel();
            EditServersWindow    win = new EditServersWindow(vm);

            win.ShowDialog();

            // Save any changes the user made to disk
            ServerManager.SaveServerListToDisk();

            if (vm.AddServerRequested)
            {
                var dlg = new AddServer();
                // AddServer saves anything added to disk (via ServerManager)
                var result = dlg.ShowDialog();
                if (IsTrue(result))
                {
                    PopulateServerList();
                    LoadUserAccounts(initialLoad: false);
                }
            }
            else if (vm.BrowseServerRequested)
            {
                var bsvm = new BrowseServerViewModel();
                var dlg  = new BrowseServer();
                dlg.DataContext = bsvm;
                var result = dlg.ShowDialog();
                // Save any changes the user made to disk
                ServerManager.SaveServerListToDisk();
                // In case user added any servers
                PopulateServerList();
                LoadUserAccounts(initialLoad: false);
            }
            else if (vm.ServersDeleted)
            {
                PopulateServerList();
                LoadUserAccounts(initialLoad: false);
            }
            MainWindowEnable();
        }
Esempio n. 5
0
        private void btnEditServers_Click(object sender, RoutedEventArgs e)
        {
            MainWindowDisable();

            EditServersViewModel vm  = new EditServersViewModel();
            EditServersWindow    win = new EditServersWindow(vm);

            win.ShowDialog();

            // Save any changes the user made to disk
            ServerManager.SaveServerListToDisk();

            if (vm.AddServerRequested)
            {
                var dlg    = new AddServer();
                var result = dlg.ShowDialog();
                if (IsTrue(result))
                {
                    PopulateServerList();
                    LoadUserAccounts(initialLoad: false);
                }
            }
            MainWindowEnable();
        }