当前位置: 首页>>代码示例>>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;未经允许,请勿转载。