A form that gathers login credentials.
Inheritance: Nexus.Client.UI.ManagedFontForm
Ejemplo n.º 1
0
        /// <summary>
        /// Logins the user into the current mod repository.
        /// </summary>
        /// <param name="p_vmlViewModel">The view model that provides the data and operations for this view.</param>
        /// <returns><c>true</c> if the user was successfully logged in;
        /// <c>false</c> otherwise</returns>
        protected bool LoginUser()
        {
			string strMessage = String.Format("You must log into the {0} website.", ModManager.ModRepository.Name);
			string strCancelWarning = String.Format("If you do not login {0} will close.", ModManager.EnvironmentInfo.Settings.ModManagerName);
            strError = booCredentialsExpired ? "You need to login using your Nexus username and password." : strError;

			LoginFormVM = new LoginFormVM(ModManager.EnvironmentInfo, ModManager.ModRepository, ModManager.GameMode.ModeTheme, strMessage, strError, strCancelWarning);

			LoginForm = new LoginForm(LoginFormVM, this);
			LoginForm.Authenticating += new EventHandler(LoginForm_Authenticating);
			LoginForm.ShowDialog();
			if (Status == TaskStatus.Complete)
				return true;
			else
			{
				if (Status == TaskStatus.Incomplete)
					OverallMessage = "You are not logged in.";
				return false;
			}
        }
		/// <summary>
		/// Logins the user into the current mod repository.
		/// </summary>
		/// <param name="p_vmlViewModel">The view model that provides the data and operations for this view.</param>
		/// <returns><c>true</c> if the user was successfully logged in;
		/// <c>false</c> otherwise</returns>
		protected bool Login(LoginFormVM p_vmlViewModel)
		{
			if (InvokeRequired)
				return (bool)Invoke((Func<LoginFormVM, bool>)Login, p_vmlViewModel);
			LoginForm frmLogin = new LoginForm(p_vmlViewModel, null);
			return frmLogin.ShowDialog(this) == DialogResult.OK;
		}