/// <summary> /// Logs the given <paramref name="usr"/> in. /// </summary> /// <param name="usr">User to log in.</param> private void LoginUser(User usr) { var session = new LastUserSession(); session.Username = usr.Username; session.Token = usr.Token; session.IsSubscriber = usr.IsSubscriber; if (MainViewModel.Client.Auth.LoadSession(session)) ActiveUser = usr; }
/// <summary> /// Add a user to the list. /// </summary> public void AddUser() { LoginView lv = new LoginView(); lv.DataContext = new LoginViewModel(); if (lv.ShowDialog().Value) { User usr = new User(MainViewModel.Client.Auth.UserSession.Username, MainViewModel.Client.Auth.UserSession.Token, MainViewModel.Client.Auth.UserSession.IsSubscriber); AvailableUsers.Add(usr); ActiveUser = usr; SerializeUsers(); } }