Ejemplo n.º 1
0
        /// <summary>
        /// Opens the registerform.
        /// </summary>
        /// <param name="sender">The object sender</param>
        /// <param name="e">The event args</param>
        private void createNewUserLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            this.Hide();
            RegisterForm registerForm = new RegisterForm(this);

            registerForm.ShowDialog(this);
        }
        /// <summary>
        /// The Event for when the user clicks the accept button. If an image has been loaded, it will return to the registerform, and the new profilepicture is displayed
        /// </summary>
        /// <param name="sender">The accept button</param>
        /// <param name="e">The EventArgs</param>
        private void AcceptButton_Click(object sender, EventArgs e)
        {
            if (editPictureBox.Image == null)
            {
                return;
            }

            if (_registerForm is RegisterForm)
            {
                RegisterForm tempregisterForm = _registerForm as RegisterForm;

                tempregisterForm.ProfileImage = CropImage(editPictureBox.Image);
            }
            else if (_registerForm is EditUserInfoForm)
            {
                EditUserInfoForm tempregisterForm = _registerForm as EditUserInfoForm;

                tempregisterForm.ProfilePicture = CropImage(editPictureBox.Image);
            }
            this.Dispose();
            _registerForm.Show();
        }