本文整理匯總了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);
}
}
}
}