示例#1
0
        private void OnUserLoggedIn(APUser user, string session)
        {
            var copy = _userLoggedIn;

            if (copy != null)
            {
                copy(this, new UserLoggedInEventArgs(user, session));
            }
        }
示例#2
0
 internal void SetUser(APUser user, string userToken)
 {
     this.LoggedInUser = user;
     this.SessionToken = userToken;
     if (user == null)
     {
         OnUserLoggedOut();
     }
     else
     {
         OnUserLoggedIn(user, userToken);
     }
 }
示例#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);
        }
示例#4
0
 protected APUser(APUser user)
     : base(user)
 {
     this.Groups = new List <GroupInfo>();
 }
示例#5
0
 public UserLoggedInEventArgs(APUser user, string sessionToken)
 {
     this.User         = user;
     this.SessionToken = sessionToken;
 }
示例#6
0
 private void OnUserLoggedIn(APUser user, string session)
 {
     var copy = _userLoggedIn;
     if (copy != null)
         copy(this, new UserLoggedInEventArgs(user, session));
 }
示例#7
0
 internal void SetUser(APUser user, string userToken)
 {
     this.LoggedInUser = user;
     this.SessionToken = userToken;
     if (user == null)
         OnUserLoggedOut();
     else
         OnUserLoggedIn(user, userToken);
 }
示例#8
0
 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;
 }
示例#10
0
        protected APUser(APUser user)
            : base(user)
        {   

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