示例#1
0
		public override void Add (ProviderBase provider)
		{
			if (provider is RoleProvider)
				base.Add (provider);
			else
				throw new HttpException ();
		}
 // adds a viewstate provider to a collection of providers.
 
 public override void Add(ProviderBase provider)
 {
     if (provider != null && provider is ViewStateProviderBase)
     {
         base.Add(provider);
     }
 }
		public override void Add (ProviderBase provider)
		{
			if (!(provider is SettingsProvider))
				throw new ArgumentException ("SettingsProvider is expected");
			if (String.IsNullOrEmpty (provider.Name))
				throw new ArgumentException ("Provider name cannot be null or empty");
			base.Add (provider);
		}
 public override void Add(ProviderBase provider)
 {
     if (provider == null)
         throw new ArgumentNullException("provider");
     if (!(provider is DirectoryNumberAnalysorProvider))
         throw new ArgumentException("Invalid provider type", "provider");
     base.Add(provider);
 }
示例#5
0
 public override void Add(ProviderBase provider)
 {
     if (provider == null)
         throw new ArgumentNullException("provider");
     if (!(provider is CallLogsProvider))
         throw new ArgumentException("Invalid provider type", "provider");
     base.Add(provider);
 }
 /// <summary>
 /// Adds a provider to the collection.
 /// </summary>
 /// <param name="provider">The provider to be added.</param>
 /// <exception cref="T:System.NotSupportedException">
 /// The collection is read-only.
 /// </exception>
 /// <exception cref="T:System.ArgumentNullException">
 /// 	<paramref name="provider"/> is null.
 /// </exception>
 /// <exception cref="T:System.ArgumentException">
 /// The <see cref="P:System.Configuration.Provider.ProviderBase.Name"/> of <paramref name="provider"/> is null.
 /// - or -
 /// The length of the <see cref="P:System.Configuration.Provider.ProviderBase.Name"/> of <paramref name="provider"/> is less than 1.
 /// </exception>
 /// <PermissionSet>
 /// 	<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/>
 /// </PermissionSet>
 public override void Add(ProviderBase provider)
 {
     if (provider == null)
         throw new ArgumentNullException("provider");
     if (!(provider is ICacheProvider))
         throw new ArgumentException("Provider must implement ICacheProvider.");
     base.Add(provider);
 }
 public override void Add(ProviderBase provider)
 {
     if (!(provider is LogProviderBase))
     {
         throw new ArgumentException("the provider is not log provider.");
     }
     base.Add(provider);
 }
 /// <summary>
 /// Adds a provider to the collection.
 /// </summary>
 /// <param name="provider">The provider to be added.</param>
 /// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
 /// <exception cref="T:System.ArgumentNullException">
 /// 	<paramref name="provider"/> is null.</exception>
 /// <exception cref="T:System.ArgumentException">The <see cref="P:System.Configuration.Provider.ProviderBase.Name"/> of <paramref name="provider"/> is null.- or -The length of the <see cref="P:System.Configuration.Provider.ProviderBase.Name"/> of <paramref name="provider"/> is less than 1.</exception>
 /// <PermissionSet>
 /// 	<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/>
 /// </PermissionSet>
 public override void Add(ProviderBase provider)
 {
     if (provider == null)
         throw new ArgumentNullException("provider");
     if (!(provider is OAuthServiceBase))
         throw new ArgumentException("Provider must implement OAuthServiceBase.");
     base.Add(provider);
 }
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
                throw new ArgumentNullException("provider");

            //if (!(provider is DataSourceProvider))
            //    throw new ArgumentException("Invalid provider type", "provider");

            base.Add(provider);
        }
        /// <summary>
        /// 向集合中添加提供程序。
        /// </summary>
        /// <param name="provider">要添加的提供程序。</param>
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
                throw new ArgumentNullException("provider is not null");

            if (!(provider is LoggingProvider))
                throw new ArgumentException("provider must LoggingProvider.");

            base.Add(provider);
        }
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
                throw new ArgumentNullException("The provider parameter cannot be null.");

            if (!(provider is GCheckoutNotificationHandlerProvider))
                throw new ArgumentException("The provider parameter must be of type GCheckoutNotificationHandlerProvider.");

            base.Add(provider);
        }
示例#12
0
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
                    throw new ArgumentNullException("The provider parameter cannot be null.");

                if (!(provider is CachingProviderBase))
                    throw new ArgumentException("The provider parameter must be of type CachingProviderBase.");

                base.Add(provider);
        }
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
                throw new ArgumentNullException("provider");

            if (provider is CommunityPathProvider == false)
                throw new ArgumentException("Invalid provider type.", "provider");

            base.Add(provider);
        }
		public override void Add(ProviderBase provider)
		{
			if (provider == null)
				throw new ArgumentNullException("provider");

			if (!(provider is BaseCompositeFileProcessingProvider))
				throw new ArgumentException("Invalid provider type", "provider");

			base.Add(provider);
		}
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
                throw new ArgumentNullException("The provider parameter cannot be null.");

            if (!(provider is PayPalReturnHandlerProvider))
                throw new ArgumentException("The provider parameter must be of type PayPalReturnHandlerProvider.");

            base.Add(provider);
        }
        /// <summary>
        /// Adds a provider to the collection.
        /// </summary>
        /// <param name="provider">The provider to be added.</param>
        /// <exception cref="T:System.NotSupportedException">The collection is read-only.</exception>
        /// <exception cref="T:System.ArgumentNullException">
        /// 	<paramref name="provider"/> is null.</exception>
        /// <exception cref="T:System.ArgumentException">The <see cref="P:System.Configuration.Provider.ProviderBase.Name"/> of <paramref name="provider"/> is null.- or -The length of the <see cref="P:System.Configuration.Provider.ProviderBase.Name"/> of <paramref name="provider"/> is less than 1.</exception>
        /// <PermissionSet>
        /// 	<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/>
        /// </PermissionSet>
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
                throw new ArgumentNullException("The provider parameter cannot be null.");

            if (!(provider is HtmlEditorProvider))
                throw new ArgumentException("The provider parameter must be of type HTMLEditorProvider.");

            base.Add(provider);
        }
		public override void Add (ProviderBase provider)
		{
			if (provider == null)
				throw new ArgumentNullException ("provider");

			if (!(provider is OutputCacheProvider))
				throw new ArgumentException ("is not of type OutputCacheProvider.", "provider");

			base.Add (provider);
		}
		/// <summary>
		/// Add a DAL provider to the collection.
		/// </summary>
		/// <param name="provider">DAL provider data.</param>
		public override void Add(ProviderBase provider)
		{
			if (provider == null)
				throw new ArgumentNullException("provider");

			if (provider is APDalProvider)
				base.Add(provider);
			else
				throw new ArgumentException("provider");
		}
		public override void Add(ProviderBase provider)
		{
			if (provider == null)
				throw new ArgumentNullException("provider");

            if (!(provider is WebFormsFileRegistrationProvider))
				throw new ArgumentException("Invalid provider type", "provider");

			base.Add(provider);
		}
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
                throw new ArgumentNullException("provider");

            if (!(provider is FilterProviderBase))
                throw new ArgumentException("The provider parameter must be of type MyProviderProvider.");

            base.Add(provider);
        }
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
                throw new ArgumentNullException("provider", "The provider parameter cannot be null.");

            if (!(provider is BaseStateProvider))
                throw new ArgumentException("provider", "The provider parameter must be of type StateProvider.");

            base.Add(provider);
        }
		public override void Add (ProviderBase provider)
		{
			if (provider == null)
				throw new ArgumentNullException ("provider");
			if (!(provider is SiteMapProvider))
				throw new InvalidOperationException(String.Format ("{0} must implement {1} to act as a site map provider", provider.GetType (), typeof (SiteMapProvider)));
			if (this [provider.Name] != null)
				throw new ArgumentException ("Duplicate site map providers");
			base.Add (provider);
		}
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            if (!(provider is SecurityController)) throw new ArgumentException("Invalid provider type", "provider");
            base.Add(provider);
        }
 internal static void CheckSchemaVersion(ProviderBase provider, SqlConnection connection, string[] features, string version, ref int schemaVersionCheck)
 {
     if (connection == null)
     {
         throw new ArgumentNullException("connection");
     }
     if (features == null)
     {
         throw new ArgumentNullException("features");
     }
     if (version == null)
     {
         throw new ArgumentNullException("version");
     }
     if (schemaVersionCheck == -1)
     {
         throw new ProviderException(System.Web.SR.GetString("Provider_Schema_Version_Not_Match", new object[] { provider.ToString(), version }));
     }
     if (schemaVersionCheck == 0)
     {
         lock (provider)
         {
             if (schemaVersionCheck == -1)
             {
                 throw new ProviderException(System.Web.SR.GetString("Provider_Schema_Version_Not_Match", new object[] { provider.ToString(), version }));
             }
             if (schemaVersionCheck == 0)
             {
                 SqlCommand command = null;
                 SqlParameter parameter = null;
                 foreach (string str in features)
                 {
                     command = new SqlCommand("dbo.aspnet_CheckSchemaVersion", connection) {
                         CommandType = CommandType.StoredProcedure
                     };
                     parameter = new SqlParameter("@Feature", str);
                     command.Parameters.Add(parameter);
                     parameter = new SqlParameter("@CompatibleSchemaVersion", version);
                     command.Parameters.Add(parameter);
                     parameter = new SqlParameter("@ReturnValue", SqlDbType.Int) {
                         Direction = ParameterDirection.ReturnValue
                     };
                     command.Parameters.Add(parameter);
                     command.ExecuteNonQuery();
                     if (((parameter.Value != null) ? ((int) parameter.Value) : -1) != 0)
                     {
                         schemaVersionCheck = -1;
                         throw new ProviderException(System.Web.SR.GetString("Provider_Schema_Version_Not_Match", new object[] { provider.ToString(), version }));
                     }
                 }
                 schemaVersionCheck = 1;
             }
         }
     }
 }
示例#25
0
 internal static void CheckSchemaVersion(ProviderBase provider, SqlConnection connection, string[] features, string version, ref int schemaVersionCheck)
 {
     if (connection == null)
     {
         throw new ArgumentNullException("connection");
     }
     if (features == null)
     {
         throw new ArgumentNullException("features");
     }
     if (version == null)
     {
         throw new ArgumentNullException("version");
     }
     if (schemaVersionCheck == -1)
     {
         throw new ProviderException("Provider schema version not match");
     }
     if (schemaVersionCheck == 0)
     {
         lock (provider)
         {
             if (schemaVersionCheck == -1)
             {
                 throw new ProviderException("Provider schema version not match");
             }
             if (schemaVersionCheck == 0)
             {
                 foreach (var str in features)
                 {
                     var command = new SqlCommand("dbo.aspnet_CheckSchemaVersion", connection)
                                              {
                                                  CommandType = CommandType.StoredProcedure
                                              };
                     var parameter = new SqlParameter("@Feature", str);
                     command.Parameters.Add(parameter);
                     parameter = new SqlParameter("@CompatibleSchemaVersion", version);
                     command.Parameters.Add(parameter);
                     parameter = new SqlParameter("@ReturnValue", SqlDbType.Int)
                                     {
                                         Direction = ParameterDirection.ReturnValue
                                     };
                     command.Parameters.Add(parameter);
                     command.ExecuteNonQuery();
                     if (((parameter.Value != null) ? ((int)parameter.Value) : -1) != 0)
                     {
                         schemaVersionCheck = -1;
                         throw new ProviderException("Provider schema version not match");
                     }
                 }
                 schemaVersionCheck = 1;
             }
         }
     }
 }
        /// <summary>
        /// Adds a provider to the collection.
        /// </summary>
        /// <param name="provider">The provider to be added.</param>
        /// <permissionSet class="System.Security.permissionSet" version="1">
        ///     <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="UnmanagedCode, ControlEvidence"/>
        /// </permissionSet>
        public override void Add(
            System.Configuration.Provider.ProviderBase provider)
        {
            if (!(provider is T))
            {
                throw new ArgumentException(
                          String.Format("The provider is not of type {0}.", typeof(T).ToString()));
            }

            this.Add((T)provider);
        }
 public override void Add(ProviderBase provider)
 {
     if (provider == null)
         throw new ArgumentNullException("provider");
     if (!(provider is UrlRewritingProvider))
     {
         string msg = string.Format("Provider must implement type {0}", typeof(UrlRewritingProvider).ToString());
         throw new ArgumentException(msg, "provider");
     }
     base.Add(provider);
 }
示例#28
0
        public virtual void Add(ProviderBase provider)
        {
            if (provider == null)
                throw new ArgumentNullException("provider");

            if (!(provider is BillingProvider))
                throw new ArgumentException
                    ("Invalid provider type", "provider");

            base.Add(provider);
        }
        public override void Add(ProviderBase provider) {
            if (provider == null) {
                throw new ArgumentNullException("provider");
            }

            if (!(provider is MembershipProvider)) {
                throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, ApplicationServicesStrings.Provider_must_implement_type, typeof(MembershipProvider).ToString()), "provider");
            }

            base.Add(provider);
        }
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
                throw new ArgumentNullException("provider", "The provider parameter cannot be null.");

            if (!(provider is ProjectUserProfileProviderBase))
                throw new ArgumentException("The provider parameter must be of type ProjectUserProfileProviderBase.",
                                            "provider");

            base.Add(provider);
        }
        public static void AddProvider(this ProviderCollection pc, ProviderBase provider)
        {
            bool prevValue = (bool)ProviderCollectionReadOnlyField.GetValue(pc);
            if (prevValue)
                ProviderCollectionReadOnlyField.SetValue(pc, false);

            pc.Add(provider);

            if (prevValue)
                ProviderCollectionReadOnlyField.SetValue(pc, true);
        }
示例#32
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="provider"></param>
        public override void Add(System.Configuration.Provider.ProviderBase provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            if (!(provider is UserManager.ProviderBase))
            {
                throw new ArgumentException("The provider parameter must be of type UserManager.ProviderBase.", "provider");
            }

            base.Add(provider);
        }
示例#33
0
        /// <summary>
        /// Adds a provider to the collection.
        /// </summary>
        /// <param name="provider">The provider to add to the collection.</param>
        public override void Add(prov.ProviderBase provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            if (!(provider is T))
            {
                throw new ArgumentException("Input must be of type " + typeof(T).FullName);
            }

            base.Add(provider);
        }
        public override void Add(System.Configuration.Provider.ProviderBase provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }
            //If Not TypeOf provider Is MyProviderBase Then Throw New ArgumentException("Invalid provider type", "provider")

            //' add
            //MyBase.Add(provider)
            if (!(provider is SQLServerStorageProvider))
            {
                throw new ArgumentException("Invalid provider type", "provider");
            }
            base.Add(provider);
        }
 public virtual new void Add(ProviderBase provider)
 {
 }