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