//Private methods private void displayLoginUser(LoginUserAttribute loginAttribute, bool showErrorLoggingIn = false) { //The collected function for login user (retrieve login credentials) if (loginAttribute == LoginUserAttribute.Name) { System.Console.Clear(); System.Console.WriteLine(""); System.Console.WriteLine("Login user"); System.Console.WriteLine("*************");; } if (showErrorLoggingIn) { ShowErrorMessage("Sorry could not log in, please try again."); } System.Console.WriteLine(""); View.ActionEnum backAction; View.ActionEnum anyInputEnteredAction = View.ActionEnum.NotSpecified; List<InputAction> specificInputs = new List<InputAction>(); System.Console.Write("Please enter " + loginAttribute.ToString().ToLower() + ": "); backAction = View.ActionEnum.GoToMainMenu; if (loginAttribute == LoginUserAttribute.Name) { anyInputEnteredAction = View.ActionEnum.LoginSpecifyingName; } else if (loginAttribute == LoginUserAttribute.Password) { anyInputEnteredAction = View.ActionEnum.LoginSpecifyingPassword; } if (anyInputEnteredAction == View.ActionEnum.NotSpecified) { //should never happen (as long as no new attributes are added without taking care of them here) throw new Exception("No login action specified for attribute " + loginAttribute); } //add the any input action specificInputs.Add(new InputAction("", anyInputEnteredAction)); //set the current possible input this.setPossibleInputActions(specificInputs, backAction); }
public void DisplayLoginUserAttribute(LoginUserAttribute attribute, bool showErrorLoggingIn = false) { this.displayLoginUser(attribute, showErrorLoggingIn); }