Ejemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            SrvForm srvForm = new SrvForm();

            srvForm.ShowDialog();

            if (!srvForm.SaveData)
            {
                return;
            }

            var name         = srvForm.NameSrv.Text;
            var adress       = srvForm.AddressSrv.Text;
            var isDomainAuth = (bool)srvForm.IsDomainAuth.IsChecked;
            var login        = srvForm.LoginSrv.Text;
            var pass         = srvForm.PassSrv.Password;

            if ((bool)srvForm.srvType.IsChecked)
            {
                LinuxServer newSrv = new LinuxServer(name, adress, isDomainAuth, login, pass);
                Config.AddNewServer(newSrv);
            }
            else
            {
                WindowsServer newSrv = new WindowsServer(name, adress, isDomainAuth, login, pass);
                Config.AddNewServer(newSrv);
            }

            RefreshTabComtrols();
        }
Ejemplo n.º 2
0
        private void EditServer_Click(object sender, RoutedEventArgs e)
        {
            var selectedSrv = RootTabControl.SelectedIndex == 0
                        ? WindowsTabControl.SelectedItem : LinuxTabControl.SelectedItem;

            if (selectedSrv == null)
            {
                return;
            }

            SrvForm srvForm = new SrvForm((Server)selectedSrv);

            srvForm.ShowDialog();

            if (!srvForm.SaveData)
            {
                RefreshTabComtrols();
                return;
            }

            srvForm.OldSrv.Name         = srvForm.Srv.Name;
            srvForm.OldSrv.Address      = srvForm.Srv.Address;
            srvForm.OldSrv.IsDomainAuth = srvForm.Srv.IsDomainAuth;
            srvForm.OldSrv.Login        = srvForm.Srv.Login;
            srvForm.OldSrv.Pass         = srvForm.Srv.Pass;

            if (srvForm.PassSrv.Password != "..!..")
            {
                srvForm.OldSrv.Pass = srvForm.PassSrv.Password;
            }

            Config.SaveConf();
            RefreshTabComtrols();
        }