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


C# XPClassInfo.CreateCustomMember方法代码示例

本文整理汇总了C#中XPClassInfo.CreateCustomMember方法的典型用法代码示例。如果您正苦于以下问题:C# XPClassInfo.CreateCustomMember方法的具体用法?C# XPClassInfo.CreateCustomMember怎么用?C# XPClassInfo.CreateCustomMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XPClassInfo的用法示例。


在下文中一共展示了XPClassInfo.CreateCustomMember方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetMemberInfo

 static XpandCustomMemberInfo GetMemberInfo(IModelRuntimeMember modelMember, XPClassInfo xpClassInfo) {
     if (modelMember is IModelRuntimeCalculatedMember)
         return xpClassInfo.CreateCalculabeMember(modelMember.Name, modelMember.Type,
                                               new Attribute[] { new PersistentAliasAttribute(((IModelRuntimeCalculatedMember)modelMember).AliasExpression) });
     if (modelMember is IModelRuntimeOrphanedColection) {
         var modelRuntimeOrphanedColection = ((IModelRuntimeOrphanedColection)modelMember);
         return xpClassInfo.CreateCollection(modelMember.Name, modelRuntimeOrphanedColection.CollectionType.TypeInfo.Type,
                                             modelRuntimeOrphanedColection.Criteria);
     }
     return xpClassInfo.CreateCustomMember(modelMember.Name, modelMember.Type, modelMember is IModelRuntimeNonPersistentMember);
 }
开发者ID:kevin3274,项目名称:eXpand,代码行数:11,代码来源:RuntimeMemberBuilder.cs

示例2: GetMemberInfo

 static XpandCustomMemberInfo GetMemberInfo(IModelRuntimeMember modelMember, XPClassInfo xpClassInfo) {
     var calculatedMember = modelMember as IModelRuntimeCalculatedMember;
     if (calculatedMember != null)
         return xpClassInfo.CreateCalculabeMember(calculatedMember.Name, calculatedMember.Type, calculatedMember.AliasExpression);
     var member = modelMember as IModelRuntimeOrphanedColection;
     if (member != null) {
         var modelRuntimeOrphanedColection = member;
         return xpClassInfo.CreateCollection(member.Name, modelRuntimeOrphanedColection.CollectionType.TypeInfo.Type,
                                             modelRuntimeOrphanedColection.Criteria);
     }
     return xpClassInfo.CreateCustomMember(modelMember.Name, modelMember.Type, modelMember is IModelRuntimeNonPersistentMember);
 }
开发者ID:dimajanzen,项目名称:eXpand,代码行数:12,代码来源:RuntimeMemberBuilder.cs

示例3: CreateMemberInfo

 static XpandCustomMemberInfo CreateMemberInfo(IModelMemberEx modelMemberEx, XPClassInfo xpClassInfo) {
     var calculatedMember = modelMemberEx as IModelMemberCalculated;
     if (calculatedMember != null)
         return xpClassInfo.CreateCalculabeMember(calculatedMember.Name, calculatedMember.Type, calculatedMember.AliasExpression);
     var modelMemberOrphanedColection = modelMemberEx as IModelMemberOrphanedColection;
     if (modelMemberOrphanedColection != null) {
         return xpClassInfo.CreateCollection(modelMemberOrphanedColection.Name, modelMemberOrphanedColection.CollectionType.TypeInfo.Type,
                                             modelMemberOrphanedColection.Criteria);
     }
     var modelMemberOneToManyCollection = modelMemberEx as IModelMemberOneToManyCollection;
     if (modelMemberOneToManyCollection!=null) {
         var elementType = modelMemberOneToManyCollection.CollectionType.TypeInfo.Type;
         var associationAttribute = new AssociationAttribute(modelMemberOneToManyCollection.AssociationName, elementType);
         var xpandCollectionMemberInfo = xpClassInfo.CreateCollection(modelMemberOneToManyCollection.Name, elementType, null, associationAttribute);
         modelMemberOneToManyCollection.AssociatedMember.ModelClass.TypeInfo.FindMember(modelMemberOneToManyCollection.AssociatedMember.Name).AddAttribute(associationAttribute);
         return xpandCollectionMemberInfo;
     }
     return xpClassInfo.CreateCustomMember(modelMemberEx.Name, modelMemberEx.Type, modelMemberEx is IModelMemberNonPersistent);
 }
开发者ID:noxe,项目名称:eXpand,代码行数:19,代码来源:RuntimeMemberBuilder.cs


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