Exemplo n.º 1
0
        public bool PromptPassword(nsIDOMWindow aParent, string aDialogTitle, string aText, ref string aPassword, string aCheckMsg, ref System.Boolean aCheckState)
        {
#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, "", aPassword, aCheckMsg, checkState);
            dialog.DisableUserName();
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                aPassword = dialog.Password;
#if false // Changes made when using autogenerated interfaces.
                if (aCheckState != IntPtr.Zero)
                {
                    Marshal.WriteIntPtr(aCheckState, dialog.IsChecked ? new IntPtr(-1) : new IntPtr(0));
                }
#else
                aCheckState = dialog.IsChecked;
#endif
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public bool PromptPassword(nsIDOMWindow aParent, string aDialogTitle, string aText, ref string aPassword, string aCheckMsg, bool [] aCheckState)
        {
            PasswordDialog dialog = new PasswordDialog(aDialogTitle, aText, "", aPassword, aCheckMsg);

            dialog.DisableUserName();
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                aPassword = dialog.Password;
                if (aCheckState != null)
                {
                    aCheckState[0] = dialog.IsChecked;
                }
                return(true);
            }

            return(false);
        }
Exemplo n.º 4
0
        public bool PromptPassword(nsIDOMWindow aParent, string aDialogTitle, string aText, ref string aPassword, string aCheckMsg, IntPtr aCheckState)
        {
            bool checkState = (aCheckState == IntPtr.Zero) ? false : (Marshal.ReadIntPtr(aCheckState) != IntPtr.Zero);

            PasswordDialog dialog = new PasswordDialog(aDialogTitle, aText, "", aPassword, aCheckMsg, checkState);

            dialog.DisableUserName();
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                aPassword = dialog.Password;
                if (aCheckState != IntPtr.Zero)
                {
                    Marshal.WriteIntPtr(aCheckState, dialog.IsChecked ? new IntPtr(-1) : new IntPtr(0));
                }
                return(true);
            }

            return(false);
        }
Exemplo n.º 5
0
        public bool PromptUsernameAndPassword(nsIDOMWindow aParent, string aDialogTitle, string aText, ref string aUsername, ref string aPassword, string aCheckMsg, bool [] aCheckState)
        {
            //test: http://tools.dynamicdrive.com/password/example/

            PasswordDialog dialog = new PasswordDialog(aDialogTitle, aText, aUsername, aPassword, aCheckMsg);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                aUsername = dialog.UserName;
                aPassword = dialog.Password;
                if (aCheckState != null)
                {
                    aCheckState[0] = dialog.IsChecked;
                }
                return(true);
            }

            return(false);
        }
Exemplo n.º 6
0
        public bool PromptUsernameAndPassword(nsIDOMWindow aParent, string aDialogTitle, string aText, ref string aUsername, ref string aPassword, string aCheckMsg, IntPtr aCheckState)
        {
            //test: http://tools.dynamicdrive.com/password/example/

            bool checkState = (aCheckState == IntPtr.Zero) ? false : (Marshal.ReadIntPtr(aCheckState) != IntPtr.Zero);

            using (PasswordDialog dialog = new PasswordDialog(aDialogTitle, aText, aUsername, aPassword, aCheckMsg, checkState))
            {
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    aUsername = dialog.UserName;
                    aPassword = dialog.Password;
                    // 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));
                    }
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 7
0
		public bool PromptPassword(nsIDOMWindow aParent, string aDialogTitle, string aText, ref string aPassword, string aCheckMsg, bool [] aCheckState)
		{
			PasswordDialog dialog = new PasswordDialog(aDialogTitle, aText, "", aPassword, aCheckMsg);
			dialog.DisableUserName();
			if (dialog.ShowDialog() == DialogResult.OK)
			{
				aPassword = dialog.Password;
				if (aCheckState != null)
					aCheckState[0] = dialog.IsChecked;
				return true;
			}
			
			return false;
		}
Exemplo n.º 8
0
		public bool PromptUsernameAndPassword(nsIDOMWindow aParent, string aDialogTitle, string aText, ref string aUsername, ref string aPassword, string aCheckMsg, bool [] aCheckState)
		{
			//test: http://tools.dynamicdrive.com/password/example/
			
			PasswordDialog dialog = new PasswordDialog(aDialogTitle, aText, aUsername, aPassword, aCheckMsg);
			if (dialog.ShowDialog() == DialogResult.OK)
			{
				aUsername = dialog.UserName;
				aPassword = dialog.Password;
				if (aCheckState != null)
					aCheckState[0] = dialog.IsChecked;
				return true;
			}
			
			return false;
		}
        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;
        }
        public bool PromptPassword(nsIDOMWindow aParent, string aDialogTitle, string aText, ref string aPassword, string aCheckMsg, ref System.Boolean aCheckState)
        {
            #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, "", aPassword, aCheckMsg, checkState);
            dialog.DisableUserName();
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                aPassword = dialog.Password;
            #if false // Changes made when using autogenerated interfaces.
                if (aCheckState != IntPtr.Zero)
                    Marshal.WriteIntPtr(aCheckState, dialog.IsChecked ? new IntPtr(-1) : new IntPtr(0));
            #else
                aCheckState = dialog.IsChecked;
            #endif
                return true;
            }

            return false;
        }
Exemplo n.º 11
0
		public bool PromptPassword(nsIDOMWindow aParent, string aDialogTitle, string aText, ref string aPassword, string aCheckMsg, IntPtr aCheckState)
		{
			bool checkState = (aCheckState == IntPtr.Zero) ? false : (Marshal.ReadIntPtr(aCheckState) != IntPtr.Zero);
			
			PasswordDialog dialog = new PasswordDialog(aDialogTitle, aText, "", aPassword, aCheckMsg, checkState);
			dialog.DisableUserName();
			if (dialog.ShowDialog() == DialogResult.OK)
			{
				aPassword = dialog.Password;
				if (aCheckState != IntPtr.Zero)
					Marshal.WriteIntPtr(aCheckState, dialog.IsChecked ? new IntPtr(-1) : new IntPtr(0));
				return true;
			}
			
			return false;
		}
Exemplo n.º 12
0
		public bool PromptUsernameAndPassword(nsIDOMWindow aParent, string aDialogTitle, string aText, ref string aUsername, ref string aPassword, string aCheckMsg, IntPtr aCheckState)
		{
			//test: http://tools.dynamicdrive.com/password/example/
			
			bool checkState = (aCheckState == IntPtr.Zero) ? false : (Marshal.ReadIntPtr(aCheckState) != IntPtr.Zero);
			
			PasswordDialog dialog = new PasswordDialog(aDialogTitle, aText, aUsername, aPassword, aCheckMsg, checkState);
			if (dialog.ShowDialog() == DialogResult.OK)
			{
			      aUsername = dialog.UserName;
			      aPassword = dialog.Password;
				
				// 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));
				
			      return true;
			}
			
			return false;
		}