public FriendFinder(CurrentUser currentUser)
        {
            InitializeComponent();

            // Init members
            _currentUser = currentUser;
            _sshService = new SshService(_currentUser);
            _otherUsers = new BindingList<SshUser>();
            otherUsersGrid.DataSource = _otherUsers;

            // Init background worker
            _friendFinder = new BackgroundWorker();
            _friendFinder.WorkerSupportsCancellation = true;
            _friendFinder.DoWork += _friendFinder_DoWork;

            // Init delegates.
            _updateFriendsList = new updateFriendListDelagate(updateFriendsList);

            // Start'er Up
            tryGetUsers();
        }
 private void loginBtn_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(userLabel.Text))
     {
         statusLabel.Text = "Please enter a username.";
     }
     else if (String.IsNullOrEmpty(passwordLabel.Text))
     {
         statusLabel.Text = "Please enter a password";
     }
     else
     {
         _currentUser = new CurrentUser(userEdit.Text, passwordEdit.Text);
         if (SshService.TestCredentials(_currentUser.GetPasswordConenctionInfo(SshSettings.Host)))
         {
             this.DialogResult = System.Windows.Forms.DialogResult.OK;
             this.Close();
         }
         else
         {
             statusLabel.Text = "Incorrect username or password.";
         }
     }
 }
 public SshService(CurrentUser currentUser)
 {
     _currentUser = currentUser;
 }