System.Web.Profile.ProfileBase.Initialize C# (CSharp) Method

Initialize() public method

public Initialize ( string username, bool isAuthenticated ) : void
username string
isAuthenticated bool
return void
		public void Initialize (string username, bool isAuthenticated)
		{
			_settingsContext = new SettingsContext ();
			_settingsContext.Add ("UserName", username);
			_settingsContext.Add ("IsAuthenticated", isAuthenticated);
			SettingsProviderCollection spc = new SettingsProviderCollection();
			spc.Add (ProfileManager.Provider);
			base.Initialize (Context, ProfileBase.Properties, spc);
		}

Usage Example

Esempio n. 1
0
        public static ProfileBase Create(string username, bool isAuthenticated)
        {
            ProfileBase profile     = null;
            Type        profileType = ProfileParser.GetProfileCommonType(HttpContext.Current);

            if (profileType != null)
            {
                profile = (ProfileBase)Activator.CreateInstance(profileType);
            }
            else
            {
                profile = (ProfileBase) new DefaultProfile();
            }

            profile.Initialize(username, isAuthenticated);
            return(profile);
        }
All Usage Examples Of System.Web.Profile.ProfileBase::Initialize