/// <summary>
        /// <para>Gets the configuration object <see cref="Type"/> for the factory to create given the <paramref name="profileProviderName"/>.</para>
        /// </summary>
        /// <param name="profileProviderName">
        /// <para>The name of the <see cref="IProfileProvider"/> to create.</para>
        /// </param>
        /// <returns>
        /// <para>The <see cref="Type"/> of the <see cref="IProfileProvider"/> to create.</para>
        /// </returns>
        protected override Type GetConfigurationType(string profileProviderName)
        {
            SecurityConfigurationView securityConfigurationView = (SecurityConfigurationView)CreateConfigurationView();
            ProfileProviderData       profileProviderData       = securityConfigurationView.GetProfileProviderData(profileProviderName);

            return(GetType(profileProviderData.TypeName));
        }
Beispiel #2
0
 /// <summary>
 /// Initializes with configuration data and display name.
 /// </summary>
 /// <param name="profileProviderData">The configuration data.</param>
 protected ProfileProviderNode(ProfileProviderData profileProviderData) : base()
 {
     if (profileProviderData == null)
     {
         throw new ArgumentNullException("data");
     }
     this.profileProviderData = profileProviderData;
 }
Beispiel #3
0
 /// <summary>
 /// Initializes with configuration data and display name.
 /// </summary>
 /// <param name="profileProviderData">The configuration data.</param>
 protected ProfileProviderNode(ProfileProviderData profileProviderData)
     : base()
 {
     if (profileProviderData == null)
     {
         throw new ArgumentNullException("data");
     }
     this.profileProviderData = profileProviderData;
 }
Beispiel #4
0
        private Data.Database GetSecurityDatabase()
        {
            ProfileProviderData profileProviderData = securityConfigurationView.GetProfileProviderData(ConfigurationName);

            ArgumentValidation.CheckExpectedType(profileProviderData, typeof(DbProfileProviderData));

            DbProfileProviderData   dbProfileProviderData = (DbProfileProviderData)profileProviderData;
            DatabaseProviderFactory factory = new DatabaseProviderFactory(securityConfigurationView.ConfigurationContext);

            return(factory.CreateDatabase(dbProfileProviderData.Database));
        }
        /// <summary>
        /// <para>Gets the named <see cref="ProfileProviderData"/> from configuration.</para>
        /// </summary>
        /// <param name="profileProviderName">
        /// <para>The name of the <see cref="ProfileProviderData"/> to get the data.</para>
        /// </param>
        /// <returns>
        /// <para>The named <see cref="ProfileProviderData"/> from configuration.</para>
        /// </returns>
        public virtual ProfileProviderData GetProfileProviderData(string profileProviderName)
        {
            SecuritySettings    settings = GetSecuritySettings();
            ProfileProviderData data     = settings.ProfileProviders[profileProviderName];

            if (data == null)
            {
                throw new ConfigurationException(SR.ExceptionProfileProviderNotFound(profileProviderName));
            }
            return(data);
        }
Beispiel #6
0
        public void IndexerTest()
        {
            ProfileProviderDataCollection collection =
                new ProfileProviderDataCollection();
            MockProfileProviderData providerData =
                new MockProfileProviderData();

            providerData.Name             = "provider1";
            collection[providerData.Name] = providerData;
            Assert.AreEqual(1, collection.Count);
            ProfileProviderData compareData =
                collection["provider1"];

            Assert.AreSame(providerData, compareData);
        }