本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
}