Пример #1
0
 /// <summary>
 /// Creates new instance of <see cref="UserContext"/>
 /// </summary>
 /// <param name="initData">initialization data</param>
 public UserContext(UserContextInitData initData)
     : base(initData)
 {
     this.CurrentUserToken         = initData.CurrentUserToken;
     this.userDataProviderResolver = initData.UserDataProviderResolver;
     this.currentUserData          = new SingletonVariable <UserData>(() => this.LoadUserData(this.CurrentUserToken));
 }
Пример #2
0
		/// <summary>
		/// Gets current user context
		/// </summary>
		/// <param name="currentUserToken">current user token</param>
		/// <returns>current user context</returns>
		public UserContext GetCurrentUserContext(UserToken currentUserToken)
		{
			var userContextInitData = new UserContextInitData(this.contextInitData)
			{
				CurrentUserToken = currentUserToken,
				UserDataProviderResolver = this.userDataProviderResolver,
			};
			return new UserContext(userContextInitData);
		}
Пример #3
0
        /// <summary>
        /// Gets current user context
        /// </summary>
        /// <param name="currentUserToken">current user token</param>
        /// <returns>current user context</returns>
        public UserContext GetCurrentUserContext(UserToken currentUserToken)
        {
            var userContextInitData = new UserContextInitData(this.contextInitData)
            {
                CurrentUserToken         = currentUserToken,
                UserDataProviderResolver = this.userDataProviderResolver,
            };

            return(new UserContext(userContextInitData));
        }