예제 #1
0
        private void SetupActiveFilterCriteriaToControl()
        {
            IObjectSpace objectSpace = _columnViewEditor.CollectionSource.ObjectSpace;
            ITypeInfo    typeInfo    = Model.ModelClass.TypeInfo;

            using (objectSpace.CreateParseCriteriaScope()){
                CriteriaOperator criteriaOperator = objectSpace.ParseCriteria(Model.Filter);
                if (_columnViewEditor.IsAsyncServerMode())
                {
                    new AsyncServerModeCriteriaProccessor(typeInfo).Process(criteriaOperator);
                }
                var criteriaProcessor = new FilterWithObjectsProcessor(objectSpace, typeInfo, _columnViewEditor.IsAsyncServerMode());
                criteriaProcessor.Process(criteriaOperator, FilterWithObjectsProcessorMode.StringToObject);
                var enumParametersProcessor = new EnumPropertyValueCriteriaProcessor(_columnViewEditor.CollectionSource.ObjectTypeInfo);
                enumParametersProcessor.Process(criteriaOperator);
                Control.ActiveFilterCriteria = criteriaOperator;
            }
        }
        private CriteriaOperator SetCollectionSourceCriteria(FiltersByCollectionWrapper filtersByCollectionWrapper)
        {
            var session = ((XPObjectSpace)ObjectSpace).Session;

            if (!string.IsNullOrEmpty(filtersByCollectionWrapper.PropertyPathFilter))
            {
                CriteriaOperator criteriaOperator = ObjectSpace.ParseCriteria(filtersByCollectionWrapper.PropertyPathFilter);
                OnPropertyPathFilterParsed(criteriaOperator);
                var criteriaProcessor = new FilterWithObjectsProcessor(ObjectSpace, View.ObjectTypeInfo, IsAsyncServerMode());
                criteriaProcessor.Process(criteriaOperator, FilterWithObjectsProcessorMode.StringToObject);
                var enumParametersProcessor = new EnumPropertyValueCriteriaProcessor(View.ObjectTypeInfo);
                enumParametersProcessor.Process(criteriaOperator);
                var patchXpoSpecificFieldNameForGridCriteriaProcessor = new PatchXpoSpecificFieldNameProcessor();
                patchXpoSpecificFieldNameForGridCriteriaProcessor.Process(criteriaOperator);

                var classInfo = session.GetClassInfo(View.ObjectTypeInfo.Type);
                var criterion = new PropertyPathParser(classInfo, session).Parse(filtersByCollectionWrapper.PropertyPath, criteriaOperator.ToString());
                View.CollectionSource.Criteria[filtersByCollectionWrapper.ID] = criterion;
                return(criteriaOperator);
            }
            return(null);
        }
예제 #3
0
		protected virtual void SetActiveFilterCriteria() {
			IObjectSpace objectSpace = CollectionSource.ObjectSpace;
			ITypeInfo typeInfo = Model.ModelClass.TypeInfo;
			CriteriaOperator criteriaOperator = objectSpace.ParseCriteria(Model.Filter);
			if (IsAsyncServerMode()) {
				new AsyncServerModeCriteriaProccessor(typeInfo).Process(criteriaOperator);
			}
			FilterWithObjectsProcessor criteriaProcessor = new FilterWithObjectsProcessor(objectSpace, typeInfo, IsAsyncServerMode());
			criteriaProcessor.Process(criteriaOperator, FilterWithObjectsProcessorMode.StringToObject);
			EnumPropertyValueCriteriaProcessor enumParametersProcessor = new EnumPropertyValueCriteriaProcessor(CollectionSource.ObjectTypeInfo);
			enumParametersProcessor.Process(criteriaOperator);
			GridView.ActiveFilterCriteria = criteriaOperator;
		}