예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="hosts"></param>
        public static void SaveHostsInfos(List <HostInfo> hosts)
        {
            var json          = JsonConvert.SerializeObject(hosts);
            var encryptedJson = EncrytionHelper.Encrypt(json);

            File.WriteAllText(HostsFile, encryptedJson);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SaveButton_Click(object sender, RoutedEventArgs e)
        {
            if (!string.IsNullOrEmpty(PasswordBox.Password))
            {
                ViewModel.SftpPassword = EncrytionHelper.Encrypt(PasswordBox.Password);
            }

            SetTaskData(ViewModel);
            Close();
        }
예제 #3
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();
        }
예제 #4
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();
        }