protected override bool?UiSubmit(string jobName, string printerName, string fclInfo, Dictionary <string, string> driverSettings, Stream xpsStream) { AttachDebugger(); bool validCredentials = false; string account = GetPropertyResult("account", ""); // Read the credentials from the workflow string username = GetPropertyResult("username", ""); string password = GetPropertyResult("password", ""); var client1 = new SampleEtherFaxApi(account, username, password); if (client1.ValidateCredentials()) { validCredentials = true; } else { // Prompt the user for credentials while (!validCredentials) { var cred = new CredentialInputDialogWpf(null, false) { Topmost = true, Message = "The workflow failed to authenticate to EtherFax. Please re-enter the credentials.", Username = username, UseWindowsCredentials = false, NextText = "Ok" }; if (cred.ShowDialog().Value) { var client2 = new SampleEtherFaxApi(account, cred.Username, cred.Password); if (client2.ValidateCredentials()) { validCredentials = true; string updatedUsername = cred.Username; string updatedPassword = cred.Password; // Update the username and password values in the configured properties StaticTextProperty usernameProperty = GetProperty <StaticTextProperty>("username"); if (usernameProperty != null) { usernameProperty.Value = updatedUsername; } StaticTextProperty passwordProperty = GetProperty <StaticTextProperty>("password"); if (passwordProperty != null) { passwordProperty.Value = updatedPassword; } } } else { break; } } } if (validCredentials) { return(base.UiSubmit(jobName, printerName, fclInfo, driverSettings, xpsStream)); } else { return(false); } }