Beispiel #1
0
        public override void UpdateNode(ModelNode node)
        {
            var modelBoModel = (IModelBOModel)node;

            foreach (var modelClass in modelBoModel)
            {
                IEnumerable <CustomQueryPropertyAttribute> customQueryPropertyAttributes =
                    LinqCollectionSourceHelper.GetQueryProperties(modelClass.TypeInfo.Type);
                foreach (var customQueryPropertyAttribute in customQueryPropertyAttributes)
                {
                    if (modelClass.TypeInfo.FindMember(customQueryPropertyAttribute.Name) == null)
                    {
                        var memberInfo = modelClass.TypeInfo.CreateMember(customQueryPropertyAttribute.Name, customQueryPropertyAttribute.Type);
                        memberInfo.AddAttribute(new BrowsableAttribute(false));
                        memberInfo.AddAttribute(new NonPersistentAttribute());
                        var modelRuntimeMember = modelClass.OwnMembers.AddNode <IModelRuntimeNonPersistentMember>(customQueryPropertyAttribute.Name);
                        modelRuntimeMember.Type = customQueryPropertyAttribute.Type;
                    }
                }
            }
        }
        public override void UpdateNode(ModelNode node)
        {
            var linqViewInfo = node.Parent as IModelListViewLinq;

            if (linqViewInfo != null && !string.IsNullOrEmpty(linqViewInfo.XPQueryMethod))
            {
                var listViewInfo = (IModelListView)linqViewInfo;
                IEnumerable <CustomQueryPropertyAttribute> customQueryPropertyAttributes = LinqCollectionSourceHelper.GetQueryProperties(listViewInfo.ModelClass.TypeInfo.Type, linqViewInfo.XPQueryMethod);
                if (customQueryPropertyAttributes != null)
                {
                    AddColumnsNode(listViewInfo);
                    RemoveDefaultColumns(listViewInfo, customQueryPropertyAttributes);
                    AddQueryColumns(listViewInfo, customQueryPropertyAttributes);
                }
            }
        }