Ejemplo n.º 1
0
        private static XpandModelMemberInfo GetXpandModelMemberInfo(IModelMemberModelMember memberModelMember, XPClassInfo info)
        {
            var memberInfoData  = new ModelMemberInfoData(info, memberModelMember.Name, memberModelMember.Type, memberModelMember.ModelNodePath, memberModelMember.DeclaredType);
            var additionalDatas = memberModelMember.AdditionalMembers.Select(member => new ModelMemberInfoAdditionalData(member.Name, member.Type, member.DeclaredType)).ToArray();

            return(new XpandModelMemberInfo(memberInfoData, false, additionalDatas));
        }
Ejemplo n.º 2
0
        public XpandModelMemberInfo(ModelMemberInfoData memberInfoData, bool isReadOnly, params ModelMemberInfoAdditionalData[] additionalMembers)
            : base(memberInfoData.Owner, memberInfoData.Name, memberInfoData.MemberType, null, true, false, isReadOnly)
        {
            _modelNodePath = memberInfoData.ModelNodePath;
            foreach (var attribute in memberInfoData.ModelOwner.PropertyX(memberInfoData.ModelNodePath.Split('.').Last()).Attributes())
            {
                AddAttribute(attribute);
            }

            foreach (var additionalMember in additionalMembers)
            {
                var memberType          = typeof(ITypeInfo).IsAssignableFrom(additionalMember.MemberType)?typeof(Type):additionalMember.MemberType;
                var modelMemberInfoData = new ModelMemberInfoData(Owner, additionalMember.Name, memberType, additionalMember.Name, additionalMember.ModelOwner);
                new XpandModelMemberInfo(modelMemberInfoData, true);
            }
            _modelNodeIdMemberInfo = Owner.FindMember("ModelNode") as XpandCustomMemberInfo ?? new XpandCustomMemberInfo(Owner, "ModelNode", typeof(IModelNode), null, true, true);
        }