當前位置: 首頁>>代碼示例>>C#>>正文


C# ProviderBase.GetType方法代碼示例

本文整理匯總了C#中System.Configuration.Provider.ProviderBase.GetType方法的典型用法代碼示例。如果您正苦於以下問題:C# ProviderBase.GetType方法的具體用法?C# ProviderBase.GetType怎麽用?C# ProviderBase.GetType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Configuration.Provider.ProviderBase的用法示例。


在下文中一共展示了ProviderBase.GetType方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Add

		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);
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:10,代碼來源:SiteMapProviderCollection.cs

示例2: Add

 public override void Add(ProviderBase provider)
 {
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     if (!(provider is SiteMapProvider))
     {
         throw new ArgumentException(System.Web.SR.GetString("Provider_must_implement_the_interface", new object[] { provider.GetType().Name, typeof(SiteMapProvider).Name }), "provider");
     }
     this.Add((SiteMapProvider) provider);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:12,代碼來源:SiteMapProviderCollection.cs

示例3: Add

		public override void Add(ProviderBase provider)
		{
			if (provider == null)
			{
				throw new ArgumentNullException("provider");
			}
			if (!(provider is DistributeCacheProvider))
			{
				throw new ArgumentException(String.Format("分布式緩存提供程序的類型 {0} 必須實現或繼承 XMS.Core.Configuration.DistributeCacheProvider", provider.GetType().FullName));
			}
			base.Add(provider);
		}
開發者ID:Kjubo,項目名稱:xms.core,代碼行數:12,代碼來源:DistributeCacheProviderCollection.cs

示例4: Add

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

            if (!(provider is PersonalizationProvider)) {
                throw new ArgumentException(
                    SR.GetString(SR.Provider_must_implement_the_interface,
                        provider.GetType().FullName, "PersonalizationProvider"));
            }

            base.Add(provider);
        }
開發者ID:nlh774,項目名稱:DotNetReferenceSource,代碼行數:13,代碼來源:PersonalizationProviderCollection.cs

示例5: Add

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

            if (!(provider is SiteMapProvider))
                throw new ArgumentException(SR.GetString(SR.Provider_must_implement_the_interface, provider.GetType().Name, typeof(SiteMapProvider).Name), "provider");

            Add((SiteMapProvider)provider);
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:9,代碼來源:SiteMap.cs

示例6: Write12_ProviderBase

 private void Write12_ProviderBase(string n, string ns, ProviderBase o, bool isNullable, bool needType)
 {
     if (o == null)
     {
         if (isNullable)
         {
             base.WriteNullTagLiteral(n, ns);
         }
     }
     else if (!needType)
     {
         System.Type type = o.GetType();
         if (type != typeof(ProviderBase))
         {
             if (type == typeof(SettingsProvider))
             {
                 this.Write13_SettingsProvider(n, ns, (SettingsProvider) o, isNullable, true);
             }
             else
             {
                 if (type != typeof(ConfigurableSettingsProvider))
                 {
                     throw base.CreateUnknownTypeException(o);
                 }
                 this.Write14_ConfigurableSettingsProvider(n, ns, (ConfigurableSettingsProvider) o, isNullable, true);
             }
         }
     }
 }
開發者ID:shankithegreat,項目名稱:commanderdotnet,代碼行數:29,代碼來源:XmlSerializationWriter1.cs


注:本文中的System.Configuration.Provider.ProviderBase.GetType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。