本文整理汇总了C#中Composite.Data.DynamicTypes.DataTypeDescriptor.GetInterfaceType方法的典型用法代码示例。如果您正苦于以下问题:C# DataTypeDescriptor.GetInterfaceType方法的具体用法?C# DataTypeDescriptor.GetInterfaceType怎么用?C# DataTypeDescriptor.GetInterfaceType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composite.Data.DynamicTypes.DataTypeDescriptor
的用法示例。
在下文中一共展示了DataTypeDescriptor.GetInterfaceType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: XmlDataTypeStore
public XmlDataTypeStore(DataTypeDescriptor dataTypeDescriptor, Type dataProviderHelperType, Type dataIdClassType, IEnumerable<XmlDataTypeStoreDataScope> xmlDateTypeStoreDataScopes, bool isGeneratedDataType)
{
if (dataProviderHelperType == null) throw new ArgumentNullException("dataProviderHelperType");
if (dataIdClassType == null) throw new ArgumentNullException("dataIdClassType");
DataTypeDescriptor = dataTypeDescriptor;
DataProviderHelperType = dataProviderHelperType;
DataIdClassType = dataIdClassType;
IsGeneratedDataType = isGeneratedDataType;
_xmlDateTypeStoreDataScopes = xmlDateTypeStoreDataScopes.Evaluate();
var ordering = new List<Func<XElement, IComparable>>();
foreach (string key in dataTypeDescriptor.KeyPropertyNames)
{
XName localKey = key;
ordering.Add(f => (string)f.Attribute(localKey) ?? "");
}
Func<IEnumerable<XElement>, IOrderedEnumerable<XElement>> orderer = f => ordering.Skip(1).Aggregate(f.OrderBy(ordering.First()), Enumerable.ThenBy);
foreach (XmlDataTypeStoreDataScope xmlDataTypeStoreDataScope in _xmlDateTypeStoreDataScopes)
{
DataScopeIdentifier dataScopeIdentifier = DataScopeIdentifier.Deserialize(xmlDataTypeStoreDataScope.DataScopeName);
CultureInfo culture = CultureInfo.CreateSpecificCulture(xmlDataTypeStoreDataScope.CultureName);
Type dataType = dataTypeDescriptor.GetInterfaceType();
Action cacheFlush = () => DataEventSystemFacade.FireExternalStoreChangedEvent(dataType, dataScopeIdentifier.ToPublicationScope(), culture);
XmlDataProviderDocumentCache.RegisterExternalFileChangeAction(xmlDataTypeStoreDataScope.Filename, cacheFlush);
XmlDataProviderDocumentWriter.RegisterFileOrderer(xmlDataTypeStoreDataScope.Filename, orderer);
}
}
示例2: GeneratedTypesHelper
/// <exclude />
public GeneratedTypesHelper(DataTypeDescriptor oldDataTypeDescriptor)
{
Verify.ArgumentNotNull(oldDataTypeDescriptor, "oldDataTypeDescriptor");
_oldType = oldDataTypeDescriptor.GetInterfaceType();
_oldDataTypeDescriptor = oldDataTypeDescriptor;
Initialize();
}
示例3: UpdateDataTypeDescriptor
/// <summary>
/// </summary>
/// <param name="oldDataTypeDescriptor"></param>
/// <param name="newDataTypeDescriptor"></param>
/// <param name="originalTypeHasData"></param>
public UpdateDataTypeDescriptor(DataTypeDescriptor oldDataTypeDescriptor, DataTypeDescriptor newDataTypeDescriptor, bool originalTypeHasData = true)
{
OldDataTypeDescriptor = oldDataTypeDescriptor;
NewDataTypeDescriptor = newDataTypeDescriptor;
var interfaceType = oldDataTypeDescriptor.GetInterfaceType();
ProviderName = interfaceType != null
? DataProviderRegistry.GetWriteableDataProviderNamesByInterfaceType(interfaceType)
.SingleOrException("Failed to get data provider by type '{0}'",
"Multiple data providers for type '{0}'", interfaceType.FullName)
: DataProviderRegistry.DefaultDynamicTypeDataProviderName;
}
示例4: DropStore
public void DropStore(DataTypeDescriptor dataTypeDescriptor)
{
using (TimerProfilerFacade.CreateTimerProfiler())
{
SqlStoreManipulator.DropStoresForType(_dataProviderContext.ProviderName, dataTypeDescriptor);
InterfaceConfigurationManipulator.Remove(_dataProviderContext.ProviderName, dataTypeDescriptor);
InterfaceConfigurationElement oldElement = _interfaceConfigurationElements.FirstOrDefault(f => f.DataTypeId == dataTypeDescriptor.DataTypeId);
if (oldElement != null)
{
_interfaceConfigurationElements.Remove(oldElement);
}
Guid dataTypeId = dataTypeDescriptor.DataTypeId;
int storesRemoved = _createdSqlDataTypeStoreTables.RemoveAll(item => item.DataTypeId == dataTypeId);
if (storesRemoved > 0)
{
Type interfaceType = dataTypeDescriptor.GetInterfaceType();
_sqlDataTypeStoresContainer.ForgetInterface(interfaceType);
}
}
}
示例5: DropStore
internal static void DropStore(string providerName, DataTypeDescriptor typeDescriptor, bool makeAFlush)
{
if (providerName == null)
{
providerName = DataProviderRegistry.DefaultDynamicTypeDataProviderName;
}
_dynamicTypeManager.DropStore(providerName, typeDescriptor, makeAFlush);
var interfaceType = typeDescriptor.GetInterfaceType();
if (interfaceType != null)
{
DataProviderRegistry.UnregisterDataType(interfaceType, providerName);
}
}