private void signInButton_Click(object sender, EventArgs e) { if (!service.IsAuthenticated) { var dlg = new CredentialsForm(service); var result = dlg.ShowDialog(); if (result != DialogResult.OK) { return; } signInStatusLabel.Text = String.Format(sspSignInStatus.Get(true), dlg.Result.UserName); sspSignInButton.Update(true); } else { service.ClearSession(); sspSignInStatus.Update(false); sspSignInButton.Update(false); } }