void DialogSslClientCertificatePasswordHandler(Object sender, SvnSslClientCertificatePasswordEventArgs e) { if (Reinvoke(sender, e, DialogSslClientCertificatePasswordHandler)) { return; } using (SslClientCertificatePassPhraseDialog dlg = new SslClientCertificatePassPhraseDialog()) { dlg.Text = Strings.ConnectToSubversion; dlg.descriptionBox.Text = SharpSvnGui.MakeDescription(e.Realm, Strings.ThePassPhraseForTheClientCertificateForXatYIsRequired, Strings.ThePassPhraseForTheClientCertificateForXIsRequired); dlg.descriptionBox.Visible = true; dlg.rememberCheck.Enabled = e.MaySave; DialogResult r = RunDialog(dlg); if (r != DialogResult.OK) { e.Break = true; return; } e.Password = dlg.passPhraseBox.Text; e.Save = e.MaySave && dlg.rememberCheck.Checked; } }
void DialogSslClientCertificateHandler(Object sender, SvnSslClientCertificateEventArgs e) { if (Reinvoke(sender, e, DialogSslClientCertificateHandler)) { return; } using (SslClientCertificateFileDialog dlg = new SslClientCertificateFileDialog()) { dlg.Text = Strings.ConnectToSubversion; dlg.descriptionBox.Text = SharpSvnGui.MakeDescription(e.Realm, Strings.ACertificateFileIsRequiredForAccessingServerXatY, Strings.ACertificateFileIsRequiredForAccessingServerX); dlg.descriptionBox.Visible = true; dlg.rememberCheck.Enabled = e.MaySave; DialogResult r = RunDialog(dlg); if (r != DialogResult.OK) { e.Break = true; return; } e.CertificateFile = dlg.fileBox.Text; e.Save = e.MaySave && dlg.rememberCheck.Checked; } }
void DialogUserNameHandler(Object sender, SvnUserNameEventArgs e) { if (Reinvoke(sender, e, DialogUserNameHandler)) { return; } using (UsernameDialog dlg = new UsernameDialog()) { dlg.Text = Strings.ConnectToSubversion; dlg.descriptionBox.Text = SharpSvnGui.MakeDescription(e.Realm, Strings.TheServerXatYRequiresAUsername, Strings.TheServerXRequiresAUsername); dlg.descriptionBox.Visible = true; dlg.usernameBox.Text = e.InitialUserName ?? e.UserName ?? ""; dlg.rememberCheck.Enabled = e.MaySave; if (Image != null) { dlg.SetImage(Image); } DialogResult r = RunDialog(dlg); if (r != DialogResult.OK) { e.Break = true; return; } e.UserName = dlg.usernameBox.Text; e.Save = e.MaySave && dlg.rememberCheck.Checked; } }
void DialogUserNamePasswordHandler(Object sender, SvnUserNamePasswordEventArgs e) { if (Reinvoke(sender, e, DialogUserNamePasswordHandler)) { return; } string description = SharpSvnGui.MakeDescription(e.Realm, Strings.TheServerXatYRequiresAUsernameAndPassword, Strings.TheServerXRequiresAUsernameAndPassword); if (Environment.OSVersion.Platform == PlatformID.Win32NT && Environment.OSVersion.Version >= new Version(5, 1)) { // If Windows XP/Windows 2003 or higher: Use the windows password dialog GetUserNamePasswordWindows(e, description); return; } using (UsernamePasswordDialog dlg = new UsernamePasswordDialog()) { dlg.Text = Strings.ConnectToSubversion; dlg.descriptionBox.Text = description; dlg.descriptionBox.Visible = true; dlg.rememberCheck.Enabled = e.MaySave; if (Image != null) { dlg.SetImage(Image); } if (!string.IsNullOrEmpty(e.InitialUserName)) { dlg.usernameBox.Text = e.InitialUserName; dlg.passwordBox.Select(); } DialogResult r = RunDialog(dlg); if (r != DialogResult.OK) { e.Break = true; return; } e.UserName = dlg.usernameBox.Text; e.Password = dlg.passwordBox.Text; e.Save = e.MaySave && dlg.rememberCheck.Checked; } }