public bool PromptUsernameAndPassword(nsIDOMWindow aParent, string aDialogTitle, string aText, ref string aUsername, ref string aPassword, string aCheckMsg, ref bool aCheckState)
{
//test: http://tools.dynamicdrive.com/password/example/
#if false // Changes made when using autogenerated interfaces.
bool checkState = (aCheckState == IntPtr.Zero) ? false : (Marshal.ReadIntPtr(aCheckState) != IntPtr.Zero);
#else
bool checkState = aCheckState;
#endif
PasswordDialog dialog = new PasswordDialog(aDialogTitle, aText, aUsername, aPassword, aCheckMsg, checkState);
if (dialog.ShowDialog() == DialogResult.OK)
{
aUsername = dialog.UserName;
aPassword = dialog.Password;
#if false // Changes made when using autogenerated interfaces.
// passing aCheckState as an IntPtr instead of a bool [] fixes the some prompts
if (aCheckState != IntPtr.Zero)
Marshal.WriteIntPtr(aCheckState, dialog.IsChecked ? new IntPtr(-1) : new IntPtr(0));
#else
aCheckState = dialog.IsChecked;
#endif
return true;
}
return false;
}