private void UiSupply(WindowsFormsWebAuthenticationDialog webAuthenticationDialog) { if (webAuthenticationDialog != null) { WebBrowser webBrowser = ((WindowsFormsWebAuthenticationDialog)webAuthenticationDialog).WebBrowser; DialogHandler handler = new DialogHandler(); handler.EnterInput(userName, password); UISupplier supplier = new UISupplier(); UISupplier.Results result = supplier.SupplyUIStep(webBrowser, userName, password); if (result == UISupplier.Results.Error) { ((Form)webBrowser.Parent.Parent).Close(); } } }