示例#1
0
 public bool IsValidRegister()
 {
     if (!IsValidInput.isValidEmail(Info.Email))
     {
         return(false);
     }
     if (!IsValidInput.IsValidPassword(Info.Password))
     {
         return(false);
     }
     if (!IsValidInput.IsValidPassword(ConfirmPassword))
     {
         return(false);
     }
     if (!IsValidInput.IsValidFullName(Info.FullName))
     {
         return(false);
     }
     if (!IsValidInput.IsValidPhone(Info.Phone))
     {
         return(false);
     }
     if (Info.Password != ConfirmPassword)
     {
         return(false);
     }
     return(true);
 }
 //-------------------------------------------------------------------------------
 /// <summary>
 /// Displays an input box with the specified message and size.
 /// </summary>
 /// <param name="windowParent">Owner form.</param>
 /// <param name="Value">The text output.</param>
 /// <param name="IsValid">IsValid is a boolean function that checks input.</param>
 /// <param name="InputMessage">The message in input box.</param>
 /// <param name="Caption">Form input caption.</param>
 /// <param name="DefaultValue">Initial text as default value of FormInput.</param>
 /// <returns>One of DialogResult values</returns>
 public static DialogResult Show(IWin32Window windowParent,
                                 out string Value, IsValidInput IsValid, string InputMessage,
                                 string Caption, string DefaultValue)
 {
     return(Show(windowParent, out Value, IsValid, InputMessage,
                 Caption, DefaultValue, Size.Empty));
 }
 public bool IsValidLogin()
 {
     if (!IsValidInput.isValidEmail(InputEmail))
     {
         return(false);
     }
     if (!IsValidInput.IsValidPassword(InputPassword))
     {
         return(false);
     }
     return(true);
 }
        //-------------------------------------------------------------------------------
        /// <summary>
        /// Displays an input box with the specified message and size.
        /// </summary>
        /// <param name="windowParent">Owner form.</param>
        /// <param name="Value">The text output.</param>
        /// <param name="IsValid">IsValid is a boolean function that checks input.</param>
        /// <param name="InputMessage">The message in input box.</param>
        /// <param name="Caption">Form input caption.</param>
        /// <param name="DefaultValue">Initial text as default value of FormInput.</param>
        /// <param name="formSize">Form input size.</param>
        /// <returns>One of DialogResult values</returns>
        public static DialogResult Show(IWin32Window windowParent,
                                        out string Value, IsValidInput IsValid, string InputMessage,
                                        string Caption, string DefaultValue, Size formSize)
        {
            FormInput form = new FormInput(windowParent);

            form.labelInputMessage.Text = string.Format("       {0}", InputMessage);
            form.Text = Caption;
            form.textBoxInput.Text = DefaultValue;
            form.funcIsValidInput += IsValid;
            if (formSize != Size.Empty)
            {
                form.Size = formSize;
            }
            DialogResult result = form.ShowDialog(windowParent);

            Value = (result == DialogResult.OK)? form.stringResult: string.Empty;
            return(result);
        }
 //-------------------------------------------------------------------------------
 /// <summary>
 /// Displays an input box with the specified message and size.
 /// </summary>
 /// <param name="windowParent">Owner form.</param>
 /// <param name="Value">The text output.</param>
 /// <param name="IsValid">IsValid is a boolean function that checks input.</param>
 /// <param name="InputMessage">The message in input box.</param>
 /// <returns>One of DialogResult values</returns>
 public static DialogResult Show(IWin32Window windowParent,
                                 out string Value, IsValidInput IsValid, string InputMessage)
 {
     return(Show(windowParent, out Value, IsValid, InputMessage,
                 GetCaption(windowParent), string.Empty, Size.Empty));
 }