/// <summary> /// Processes the accounts. /// </summary> protected override void ProcessAccounts() { var defaultAccount = GetDefaultAccount(); //There's no accounts... or something bad has happened to the default if (Application.Accounts.Count == 0 || defaultAccount == null) { var login = new LoginViewController(); login.NavigationItem.LeftBarButtonItem = null; login.Login = (username, password) => { Utils.Login.LoginAccount(username, password, login); }; var navCtrl = new CustomNavigationController(this, login); Transitions.TransitionToController(navCtrl); return; } //Don't remember, prompt for password if (defaultAccount.DontRemember) { ShowAccountsAndSelectedUser(defaultAccount.Username); } //If the user wanted to remember the account else { Utils.Login.LoginAccount(defaultAccount.Username, defaultAccount.Password, this, (ex) => { ShowAccountsAndSelectedUser(defaultAccount.Username); }); } }
private void ShowAccountsAndSelectedUser(string user) { var accountsController = new AccountsController(); accountsController.NavigationItem.LeftBarButtonItem = null; var login = new LoginViewController { Username = user }; login.Login = (username, password) => { Utils.Login.LoginAccount(username, password, login); }; var navigationController = new CustomNavigationController(this, accountsController); navigationController.PushViewController(login, false); Transitions.TransitionToController(navigationController); }