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


C# XPClassInfo.FindMember方法代码示例

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


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

示例1: BaseMemberInfos

 Dictionary<string, XPMemberInfo> BaseMemberInfos(XPClassInfo outputClassInfo) {
     var members = ((InitialDataAttribute)outputClassInfo.FindAttributeInfo(typeof(InitialDataAttribute))).BaseMembers;
     var xpMemberInfos = new Dictionary<string, XPMemberInfo>();
     if (members != null) {
         var baseMembers = members.Split(',');
         foreach (var baseMember in baseMembers) {
             var strings = baseMember.Split('|');
             var xpMemberInfo = outputClassInfo.FindMember(strings[0]);
             xpMemberInfos.Add(strings[strings.Length - 1], xpMemberInfo);
         }
     }
     return xpMemberInfos;
 }
开发者ID:dimajanzen,项目名称:eXpand,代码行数:13,代码来源:ImportData.cs

示例2: GetXpMemberInfo

 public static XPMemberInfo GetXpMemberInfo(XPClassInfo xpClassInfo, string propertyName, bool throwIfMissing) {
     if (propertyName.IndexOf(".", StringComparison.Ordinal) > -1) {
         XPMemberInfo info = xpClassInfo.FindMember(propertyName.Split(".".ToCharArray())[0]);
         if (info != null) {
             XPClassInfo type = info.ReferenceType;
             if (info.IsAssociation && info.IsCollection && info.CollectionElementType != null)
                 type = info.CollectionElementType;
             return GetXpMemberInfo(type, propertyName.Substring(propertyName.IndexOf(".", StringComparison.Ordinal) + 1), throwIfMissing);
         }
         return null;
     }
     XPMemberInfo xpMemberInfo = xpClassInfo.FindMember(propertyName);
     if (xpMemberInfo == null && throwIfMissing)
         throw new PropertyMissingException(xpClassInfo.FullName, propertyName);
     return xpMemberInfo;
 }
开发者ID:aries544,项目名称:eXpand,代码行数:16,代码来源:XpandReflectionHelper.cs

示例3: CreateKey

 void CreateKey(XPClassInfo outputClassInfo, XPClassInfo classInfo) {
     var initialDataAttribute = ((InitialDataAttribute) outputClassInfo.FindAttributeInfo(typeof (InitialDataAttribute)));
     var inputKeyPropertyName = initialDataAttribute.InputKeyPropertyName;
     if (!String.IsNullOrEmpty(inputKeyPropertyName) ) {
         var member = classInfo.FindMember(inputKeyPropertyName);
         if (member == null)
             classInfo.CreateMember(inputKeyPropertyName, initialDataAttribute.inputKeyPropertyType).AddAttribute(new KeyAttribute(true));
         else {
             member.AddAttribute(new KeyAttribute(true));
         }
     }
     else if (!HasKey(classInfo)) {
         classInfo.CreateMember("Oid_" + classInfo.TableName, typeof(int)).AddAttribute(new KeyAttribute(true));
     }
 }
开发者ID:noxe,项目名称:eXpand,代码行数:15,代码来源:ImportData.cs

示例4: 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;
     }
     var modelMemberModelMember = modelMemberEx as IModelMemberModelMember;
     if (modelMemberModelMember != null){
         var memberInfo = ModelMemberModelMemberDomainLogic.Get_MemberInfo(modelMemberModelMember);
         return (XpandCustomMemberInfo) xpClassInfo.FindMember(memberInfo.Name);
     }
     return xpClassInfo.CreateCustomMember(modelMemberEx.Name, modelMemberEx.Type, modelMemberEx is IModelMemberNonPersistent);
 }
开发者ID:aries544,项目名称:eXpand,代码行数:24,代码来源:RuntimeMemberBuilder.cs


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