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);
     }
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 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);
 }
 public UserLoggedInEventArgs(APUser user, string sessionToken)
 {
     this.User = user;
     this.SessionToken = sessionToken;
 }
 /// <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;
 }
Beispiel #10
0
        protected APUser(APUser user)
            : base(user)
        {   

            this.Groups = new List<GroupInfo>();
        }
Beispiel #11
0
        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);
        }
Beispiel #12
0
 public User(Appacitive.Sdk.APUser existing)
     : base(existing)
 {
 }
Beispiel #13
0
 /// <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;
 }