public static void UpdateUser(User user, UserData userData) { Verify.Argument.IsNotNull(user, "user"); Verify.Argument.IsNotNull(userData, "userData"); user.Commits = userData.Commits; }
private void UpdateUserIdentity(bool raiseEvent) { User userIdentity; var name = _configuration.TryGetParameterValue(GitConstants.UserNameParameter); var email = _configuration.TryGetParameterValue(GitConstants.UserEmailParameter); if(name == null || email == null) { userIdentity = null; } else { if(_userIdentity == null || _userIdentity.Name != name || _userIdentity.Email != email) { userIdentity = _users.TryGetUser(name, email); if(userIdentity == null) { userIdentity = new User(this, name, email, 0); } } else { userIdentity = _userIdentity; } } if(userIdentity != _userIdentity) { _userIdentity = userIdentity; if(raiseEvent) { var handler = UserIdentityChanged; if(handler != null) handler(this, EventArgs.Empty); } } }