private void OnUserLoggedIn(APUser user, string session) { var copy = _userLoggedIn; if (copy != null) { copy(this, new UserLoggedInEventArgs(user, session)); } }
internal void SetUser(APUser user, string userToken) { this.LoggedInUser = user; this.SessionToken = userToken; if (user == null) { OnUserLoggedOut(); } else { OnUserLoggedIn(user, userToken); } }
private void UpdateIfCurrentUser(APUser updatedUser) { var platform = InternalApp.Current.Platform as IApplicationPlatform; if (platform == null || platform.ApplicationState == null) { throw new AppacitiveRuntimeException("App is not initialized."); } var user = platform.ApplicationState.GetUser(); if (user == null || user.Id != updatedUser.Id) { return; } // As the updated user is the same as the logged in user, then update the current user. platform.ApplicationState.SetUser(updatedUser); }
protected APUser(APUser user) : base(user) { this.Groups = new List <GroupInfo>(); }
public UserLoggedInEventArgs(APUser user, string sessionToken) { this.User = user; this.SessionToken = sessionToken; }
private void OnUserLoggedIn(APUser user, string session) { var copy = _userLoggedIn; if (copy != null) copy(this, new UserLoggedInEventArgs(user, session)); }
internal void SetUser(APUser user, string userToken) { this.LoggedInUser = user; this.SessionToken = userToken; if (user == null) OnUserLoggedOut(); else OnUserLoggedIn(user, userToken); }
/// <summary> /// Creates a new instance of UserSession with the given user and session token. /// </summary> /// <param name="user">The logged in user.</param> /// <param name="token">The authentication token returned by the platform.</param> public UserSession(APUser user, string token) { this.UserToken = token; this.LoggedInUser = user; }
protected APUser(APUser user) : base(user) { this.Groups = new List<GroupInfo>(); }
private void UpdateIfCurrentUser(APUser updatedUser) { var platform = InternalApp.Current.Platform as IApplicationPlatform; if (platform == null || platform.ApplicationState == null) throw new AppacitiveRuntimeException("App is not initialized."); var user = platform.ApplicationState.GetUser(); if (user == null || user.Id != updatedUser.Id) return; // As the updated user is the same as the logged in user, then update the current user. platform.ApplicationState.SetUser(updatedUser); }
public User(Appacitive.Sdk.APUser existing) : base(existing) { }