Exemplo n.º 1
0
 public void Hide()
 {
     HostLabel.Hide();
     PortLabel.Hide();
     HostTextBox.Hide();
     PortTextBox.Hide();
     StartStopWaitingConnectionBtn.Hide();
     ReturnToMenuBtn2.Hide();
 }
Exemplo n.º 2
0
 private void SetupFocus()
 {
     if (string.IsNullOrEmpty(ViewModel.Username))
     {
         UserTextBox.Focus(FocusState.Programmatic);
     }
     else if (string.IsNullOrEmpty(ViewModel.Host))
     {
         HostTextBox.Focus(FocusState.Programmatic);
     }
     else
     {
         Focus(FocusState.Programmatic);
     }
 }
Exemplo n.º 3
0
        private void SetupFocus()
        {
            SshProfileViewModel vm = (SshProfileViewModel)DataContext;

            if (string.IsNullOrEmpty(vm.Username))
            {
                UserTextBox.Focus(FocusState.Programmatic);
            }
            else if (string.IsNullOrEmpty(vm.Host))
            {
                HostTextBox.Focus(FocusState.Programmatic);
            }
            else
            {
                Focus(FocusState.Programmatic);
            }
        }
Exemplo n.º 4
0
 public void Show(bool isServerSide)
 {
     HostLabel.Show();
     PortLabel.Show();
     HostTextBox.Show();
     PortTextBox.Show();
     StartStopWaitingConnectionBtn.Show();
     ReturnToMenuBtn2.Show();
     StartStopWaitingConnectionBtn.Text = "Waiting for connection";
     HostTextBox.ReadOnly = isServerSide;
     if (isServerSide)
     {
         HostTextBox.Text = "127.0.0.1";
         PortTextBox.Text = "20";
     }
     else
     {
         HostTextBox.Text = "localhost";
         PortTextBox.Text = "20";
     }
 }
Exemplo n.º 5
0
        private void AddAndAddAnotherButton_Click(object sender, EventArgs e)
        {
            try
            {
                XMLHelper helper = new XMLHelper();

                MailServer NewServer = new MailServer()
                {
                    ID          = helper.LastElementUniqueID(XMLDataStorage.Location + "MailServers.xml", "Server") + 1,
                    Name        = NameTextBox.Text,
                    Description = DescriptionTextBox.Text,
                    Host        = HostTextBox.Text,
                    Port        = Convert.ToInt32(PortTextBox.Text),
                    Username    = UsernameTextBox.Text,
                    Password    = PasswordTextBox.Text,
                    FromAddress = FromAddressTextBox.Text,
                    IsSecured   = IsSecuredCheckbox.Checked
                };

                mailServerManager.Add(NewServer);

                MessageBox.Show("Mail Server is successfully added");

                NameTextBox.Clear();
                DescriptionTextBox.Clear();
                HostTextBox.Clear();
                PortTextBox.Clear();
                UsernameTextBox.Clear();
                PasswordTextBox.Clear();
                FromAddressTextBox.Clear();
                IsSecuredCheckbox.Checked = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Failed to add new mail server", ex.Message);
            }
        }