本文整理汇总了C#中IProvider.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IProvider.GetType方法的具体用法?C# IProvider.GetType怎么用?C# IProvider.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProvider
的用法示例。
在下文中一共展示了IProvider.GetType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Provider
internal Provider(IProvider provider)
{
this.provider = provider;
this.Properties = new ProviderPropertyList();
PropertyInfo[] properties = provider.GetType().GetProperties();
for (int i = 0; i < properties.Length; i++)
{
PropertyInfo propertyInfo = properties[i];
if (propertyInfo.CanRead && propertyInfo.CanWrite && (propertyInfo.PropertyType.IsValueType || propertyInfo.PropertyType == typeof(string)))
{
this.Properties.Add(new ProviderProperty(propertyInfo, provider));
}
}
}
示例2: getIdentCode
private String getIdentCode(IProvider provider)
{
foreach (KeyValuePair<String, String> kvPair in this.ApplicationSettings.IdentCodes) {
if (String.Compare(kvPair.Value, provider.GetType().ToString(), true) == 0) {
return kvPair.Key;
}
}
return null;
}
示例3: Provider
internal Provider(IProvider provider)
{
this.provider = provider;
this.Properties = new ProviderPropertyList();
foreach (PropertyInfo property in provider.GetType().GetProperties())
{
if (property.CanRead && property.CanWrite && (property.PropertyType.IsValueType || property.PropertyType == typeof(string)))
this.Properties.Add(new ProviderProperty(property, provider));
}
}
示例4: PrepareDataSourceForCql
private static void PrepareDataSourceForCql(IProvider provider, string cqlFilterString)
{
//for layers with a filterprovider
var filterProvider = provider as FilterProvider;
if (filterProvider != null)
{
filterProvider.FilterDelegate = row => CqlFilter(row, cqlFilterString);
return;
}
//for layers with a SQL datasource with a DefinitionQuery property
var piDefinitionQuery = provider.GetType().GetProperty("DefinitionQuery", BindingFlags.Public | BindingFlags.Instance);
if (piDefinitionQuery != null)
{
string dq = piDefinitionQuery.GetValue(provider, null) as string;
if (string.IsNullOrEmpty(dq))
piDefinitionQuery.SetValue(provider, cqlFilterString, null);
else
piDefinitionQuery.SetValue(provider, "(" + dq + ") AND (" + cqlFilterString + ")", null);
}
}
示例5: PrepareDataSourceForCql
private void PrepareDataSourceForCql(IProvider provider, string cqlFilterString)
{
// for layerNames with a filterprovider
FilterProvider filterProvider = provider as FilterProvider;
if (filterProvider != null)
{
filterProvider.FilterDelegate = row => CqlFilter(row, cqlFilterString);
return;
}
// for layerNames with a SQL datasource with a DefinitionQuery property
PropertyInfo piDefinitionQuery = provider.GetType().GetProperty("DefinitionQuery", BindingFlags.Public | BindingFlags.Instance);
if (piDefinitionQuery != null)
piDefinitionQuery.SetValue(provider, cqlFilterString, null);
}
示例6: appendProvider
private void appendProvider(IProvider newProvider)
{
//
// get available provider
IProvider currentProvider = null;
foreach (IProvider provider in this.AvailableProviders) {
if (String.Compare(newProvider.GetType().ToString(), provider.GetType().ToString()) == 0) {
currentProvider = provider;
}
}
//
// remove current provider
if (currentProvider != null) {
this.AvailableProviders.Remove(currentProvider);
// check date of providers
FileInfo currentFileInfo = new FileInfo(currentProvider.GetType().Assembly.Location);
FileInfo newFileInfo = new FileInfo(newProvider.GetType().Assembly.Location);
if (currentFileInfo.CreationTime.CompareTo(newFileInfo.CreationTime) > 0) {
newProvider = currentProvider;
}
}
//
newProvider.ApplicationSettings = this.ApplicationSettings;
newProvider.Settings = this.ApplicationSettings.getNode(new String[] { "providersettings", newProvider.GetType().ToString() });
//
// append provider
this.AvailableProviders.Add(newProvider);
}