예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            var hostInfo = new HostSubmitInfo();

            hostInfo.Host     = HostsCombobox.Text;
            hostInfo.Login    = LoginsCombobox.Text;
            hostInfo.Password = PasswordBox.Password;
            HostDataManager.SubmitHostInfo(hostInfo);

            ViewModel.SshHost     = HostsCombobox.Text;
            ViewModel.SshLogin    = LoginsCombobox.Text;
            ViewModel.ServiceName = ServiceTextBox.Text;

            if (!string.IsNullOrEmpty(PasswordBox.Password))
            {
                ViewModel.SshPassword = EncrytionHelper.Encrypt(PasswordBox.Password);
            }

            SetTaskData(ViewModel);
            Close();
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            var hostInfo = new HostSubmitInfo();

            hostInfo.Host     = HostsCombobox.Text;
            hostInfo.Login    = LoginsCombobox.Text;
            hostInfo.Password = PasswordBox.Password;
            HostDataManager.SubmitHostInfo(hostInfo);

            ViewModel.SshHost  = HostsCombobox.Text;
            ViewModel.SshLogin = LoginsCombobox.Text;
            ViewModel.Command  = CmdTextBox.Text;
            ViewModel.IsRoot   = IsRootCheckBox.IsChecked.GetValueOrDefault();

            if (!string.IsNullOrEmpty(PasswordBox.Password))
            {
                ViewModel.SshPassword = EncrytionHelper.Encrypt(PasswordBox.Password);
            }

            SetTaskData(ViewModel);
            Close();
        }