Ejemplo n.º 1
0
        public static IMemberInfo Get_MemberInfo(IModelRuntimeOrphanedColection modelRuntimeOrphanedColection)
        {
            Guard.ArgumentNotNull(modelRuntimeOrphanedColection.ModelClass, "modelMember.ModelClass");
            Guard.ArgumentNotNull(modelRuntimeOrphanedColection.ModelClass.TypeInfo, "modelMember.ModelClass.TypeInfo");
            IMemberInfo info = modelRuntimeOrphanedColection.ModelClass.TypeInfo.FindMember(modelRuntimeOrphanedColection.Name);

            if (info == null)
            {
                if (!string.IsNullOrEmpty(modelRuntimeOrphanedColection.Name) && modelRuntimeOrphanedColection.Type != null)
                {
                    var xpClassInfo = XpandModuleBase.Dictiorary.GetClassInfo(modelRuntimeOrphanedColection.ModelClass.TypeInfo.Type);
                    if (xpClassInfo.FindMember(modelRuntimeOrphanedColection.Name) == null)
                    {
                        xpClassInfo.CreateCollection(modelRuntimeOrphanedColection.Name, modelRuntimeOrphanedColection.CollectionType.TypeInfo.Type, modelRuntimeOrphanedColection.Criteria);
                        ((BaseInfo)modelRuntimeOrphanedColection.ModelClass.TypeInfo).Store.RefreshInfo(modelRuntimeOrphanedColection.ModelClass.TypeInfo.Type);
                        info = modelRuntimeOrphanedColection.ModelClass.TypeInfo.FindMember(modelRuntimeOrphanedColection.Name);
                    }
                }
            }

            if (info != null)
            {
                modelRuntimeOrphanedColection.SetValue("MemberInfo", info);
            }

            return(info);
        }
Ejemplo n.º 2
0
        public static Type Get_Type(IModelRuntimeOrphanedColection modelRuntimeOrphanedColection) {
            if (modelRuntimeOrphanedColection.CollectionType != null) {
                var type = typeof(XPCollection<>).MakeGenericType(new[] { modelRuntimeOrphanedColection.CollectionType.TypeInfo.Type });
                return type;
            }

            return null;
        }
Ejemplo n.º 3
0
        public static Type Get_Type(IModelRuntimeOrphanedColection modelRuntimeOrphanedColection)
        {
            if (modelRuntimeOrphanedColection.CollectionType != null)
            {
                var type = typeof(XPCollection <>).MakeGenericType(new[] { modelRuntimeOrphanedColection.CollectionType.TypeInfo.Type });
                return(type);
            }

            return(null);
        }
Ejemplo n.º 4
0
 public static Type Get_PropertyEditorType(IModelRuntimeOrphanedColection modelRuntimeOrphanedColection) {
     if (modelRuntimeOrphanedColection.Name != null && modelRuntimeOrphanedColection.Type != null) {
         var xpClassInfo = XafTypesInfo.XpoTypeInfoSource.XPDictionary.GetClassInfo(modelRuntimeOrphanedColection.CollectionType.TypeInfo.Type);
         if (xpClassInfo.FindMember(modelRuntimeOrphanedColection.Name) == null) {
             xpClassInfo.CreateCollection(modelRuntimeOrphanedColection.Name, modelRuntimeOrphanedColection.CollectionType.TypeInfo.Type,
                                          modelRuntimeOrphanedColection.Criteria);
             XafTypesInfo.Instance.RefreshInfo(xpClassInfo.ClassType);
             var memberInfo = modelRuntimeOrphanedColection.CollectionType.TypeInfo.FindMember(modelRuntimeOrphanedColection.Name);
             modelRuntimeOrphanedColection.SetValue("MemberInfo", memberInfo);
         }
     }
     return ModelModelMemberEditorTypeLogic.Get_PropertyEditorType(modelRuntimeOrphanedColection);
 }
Ejemplo n.º 5
0
        public static IMemberInfo Get_MemberInfo(IModelRuntimeOrphanedColection modelRuntimeOrphanedColection) {
            Guard.ArgumentNotNull(modelRuntimeOrphanedColection.ModelClass, "modelMember.ModelClass");
            Guard.ArgumentNotNull(modelRuntimeOrphanedColection.ModelClass.TypeInfo, "modelMember.ModelClass.TypeInfo");
            IMemberInfo info = modelRuntimeOrphanedColection.ModelClass.TypeInfo.FindMember(modelRuntimeOrphanedColection.Name);
            if (info == null) {
                if (!string.IsNullOrEmpty(modelRuntimeOrphanedColection.Name) && modelRuntimeOrphanedColection.Type != null) {
                    var xpClassInfo = XafTypesInfo.XpoTypeInfoSource.XPDictionary.GetClassInfo(modelRuntimeOrphanedColection.ModelClass.TypeInfo.Type);
                    if (xpClassInfo.FindMember(modelRuntimeOrphanedColection.Name) == null) {
                        xpClassInfo.CreateCollection(modelRuntimeOrphanedColection.Name, modelRuntimeOrphanedColection.CollectionType.TypeInfo.Type, modelRuntimeOrphanedColection.Criteria);
                        ((BaseInfo)modelRuntimeOrphanedColection.ModelClass.TypeInfo).Store.RefreshInfo(modelRuntimeOrphanedColection.ModelClass.TypeInfo.Type);
                        info = modelRuntimeOrphanedColection.ModelClass.TypeInfo.FindMember(modelRuntimeOrphanedColection.Name);
                    }
                }
            }

            if (info != null)
                modelRuntimeOrphanedColection.SetValue("MemberInfo", info);

            return info;
        }
Ejemplo n.º 6
0
 static IMemberInfo MemberInfo(IModelRuntimeOrphanedColection modelRuntimeOrphanedColection, XPClassInfo xpClassInfo) {
     xpClassInfo.CreateCollection(modelRuntimeOrphanedColection.Name, modelRuntimeOrphanedColection.CollectionType.TypeInfo.Type, modelRuntimeOrphanedColection.Criteria);
     ((BaseInfo)modelRuntimeOrphanedColection.ModelClass.TypeInfo).Store.RefreshInfo(modelRuntimeOrphanedColection.ModelClass.TypeInfo.Type);
     return modelRuntimeOrphanedColection.ModelClass.TypeInfo.FindMember(modelRuntimeOrphanedColection.Name);
 }
Ejemplo n.º 7
0
 public static IMemberInfo Get_MemberInfo(IModelRuntimeOrphanedColection modelRuntimeOrphanedColection) {
     Guard.ArgumentNotNull(modelRuntimeOrphanedColection.ModelClass, "modelMember.ModelClass");
     Guard.ArgumentNotNull(modelRuntimeOrphanedColection.ModelClass.TypeInfo, "modelMember.ModelClass.TypeInfo");
     IMemberInfo info = modelRuntimeOrphanedColection.ModelClass.TypeInfo.FindMember(modelRuntimeOrphanedColection.Name);
     if (info == null) {
         if (!string.IsNullOrEmpty(modelRuntimeOrphanedColection.Name) && modelRuntimeOrphanedColection.Type != null) {
             var xpClassInfo = XpandModuleBase.Dictiorary.GetClassInfo(modelRuntimeOrphanedColection.ModelClass.TypeInfo.Type);
             if (xpClassInfo.FindMember(modelRuntimeOrphanedColection.Name) == null) {
                 info = MemberInfo(modelRuntimeOrphanedColection, xpClassInfo);
             }
         }
     }
     if (info != null)
         modelRuntimeOrphanedColection.SetValue("MemberInfo", info);
     return info;
 }
Ejemplo n.º 8
0
 public static Type Get_Type(IModelRuntimeOrphanedColection modelRuntimeOrphanedColection) {
     return modelRuntimeOrphanedColection.CollectionType != null ? typeof(XPCollection<>).MakeGenericType(new[] { modelRuntimeOrphanedColection.CollectionType.TypeInfo.Type }) : null;
 }