当前位置: 首页>>代码示例>>C#>>正文


C# DataTypeDescriptor.GetInterfaceType方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:32,代码来源:XmlDataTypeStore.cs

示例2: GeneratedTypesHelper

        /// <exclude />
        public GeneratedTypesHelper(DataTypeDescriptor oldDataTypeDescriptor)
        {
            Verify.ArgumentNotNull(oldDataTypeDescriptor, "oldDataTypeDescriptor");

            _oldType = oldDataTypeDescriptor.GetInterfaceType();
            _oldDataTypeDescriptor = oldDataTypeDescriptor;

            Initialize();
        }
开发者ID:RuneAndersen,项目名称:C1-CMS,代码行数:10,代码来源:GeneratedTypesHelper.cs

示例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;
        }
开发者ID:DBailey635,项目名称:C1-CMS,代码行数:18,代码来源:UpdateDataTypeDescriptor.cs

示例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);
                }
            }
        }
开发者ID:RuneAndersen,项目名称:C1-CMS,代码行数:24,代码来源:SqlDataProvider_Stores.cs

示例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);
            }
        }
开发者ID:Orckestra,项目名称:C1-CMS,代码行数:15,代码来源:DynamicTypeManager.cs


注:本文中的Composite.Data.DynamicTypes.DataTypeDescriptor.GetInterfaceType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。