private async void button_StorePassword_Click(object sender, EventArgs e)
        {
            if (_handler != null)
            {
                return;
            }

            _department = comboBox_Department.Text;
            _username = textBox_Username.Text;
            _password = textBox_Password.Text;
            IDictionary<string, string[]> info = _manager.GetServerInfo();
            string address = info[_department][0];
            _handler = new SSH_Print.NetworkHandler(address, _username, _password);
            if (!(await _handler.CheckConnectionAsync())) 
            {
                MetroMessageBox.Show(this, Resources.CredentialIncorrectPrompt);
            }
            else
            {
                SaveCredentials();
            }
            _handler = null;
        }
예제 #2
0
        private async void button_StorePassword_Click(object sender, EventArgs e)
        {
            if (_handler != null)
            {
                return;
            }

            _department = comboBox_Department.Text;
            _username   = textBox_Username.Text;
            _password   = textBox_Password.Text;
            IDictionary <string, string[]> info = _manager.GetServerInfo();
            string address = info[_department][0];

            _handler = new SSH_Print.NetworkHandler(address, _username, _password);
            if (!(await _handler.CheckConnectionAsync()))
            {
                MetroMessageBox.Show(this, Resources.CredentialIncorrectPrompt);
            }
            else
            {
                SaveCredentials();
            }
            _handler = null;
        }