Exemplo n.º 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);
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }