예제 #1
0
        internal override void ExecuteInternal(QueryContext queryContext, ref SortedList list)
        {
            bool      sortAscending = true;
            ArrayList keys          = new ArrayList();

            if (Inverse)
            {
                sortAscending = false;
            }

            SortedList tmpList = new SortedList(new QueryResultComparer(sortAscending));

            for (int i = 0; i < members.Count; i++)
            {
                Predicate predicate = (Predicate)members[i];
                predicate.ExecuteInternal(queryContext, ref tmpList);
            }

            if (Inverse)
            {
                keys = GetUnion(tmpList);
            }
            else
            {
                keys = GetIntersection(tmpList);
            }

            if (keys != null)
            {
                list.Add(keys.Count, keys);
            }
        }
예제 #2
0
        internal override void Execute(QueryContext queryContext, Predicate nextPredicate)
        {
            for (int i = 0; i < members.Count; i++)
            {
                Predicate predicate         = (Predicate)members[i];
                bool      isOfTypePredicate = predicate is IsOfTypePredicate;

                if (isOfTypePredicate)
                {
                    predicate.Execute(queryContext, (Predicate)members[++i]);
                }
                else
                {
                    CollectionOperation mergeType = (Inverse == true || (queryContext.InternalQueryResult.Count == 0 & i == 0)) ? CollectionOperation.Union : CollectionOperation.Intersection;
                    predicate.ExecuteInternal(queryContext, mergeType);
                }
            }
        }
예제 #3
0
        internal override void Execute(QueryContext queryContext, Predicate nextPredicate)
        {
            bool sortAscending       = true;
            bool normalizePredicates = true;

            if (Inverse)
            {
                sortAscending = false;
            }

            SortedList list = new SortedList(new QueryResultComparer(sortAscending));

            for (int i = 0; i < members.Count; i++)
            {
                Predicate predicate         = (Predicate)members[i];
                bool      isOfTypePredicate = predicate is IsOfTypePredicate;

                if (isOfTypePredicate)
                {
                    predicate.Execute(queryContext, (Predicate)members[++i]);
                    normalizePredicates = false;
                }
                else
                {
                    predicate.ExecuteInternal(queryContext, ref list);
                }
            }

            if (normalizePredicates)
            {
                if (Inverse)
                {
                    queryContext.Tree.RightList = GetUnion(list);
                }
                else
                {
                    queryContext.Tree.RightList = GetIntersection(list);
                }
            }
        }
예제 #4
0
        internal override void Execute(QueryContext queryContext, Predicate nextPredicate)
        {
            for (int i = 0; i < members.Count; i++)
            {
                if (queryContext.CancellationToken != null && queryContext.CancellationToken.IsCancellationRequested)
                {
                    throw new OperationCanceledException(ExceptionsResource.OperationFailed);
                }

                Predicate predicate         = (Predicate)members[i];
                bool      isOfTypePredicate = predicate is IsOfTypePredicate;

                if (isOfTypePredicate)
                {
                    predicate.Execute(queryContext, (Predicate)members[++i]);
                }
                else
                {
                    CollectionOperation mergeType = (Inverse == true || (queryContext.InternalQueryResult.Count == 0 & i == 0)) ? CollectionOperation.Union : CollectionOperation.Intersection;
                    predicate.ExecuteInternal(queryContext, mergeType);
                }
            }
        }
예제 #5
0
        internal override void ExecuteInternal(QueryContext queryContext, CollectionOperation mergeType)
        {
            bool sortAscending      = true;
            ClusteredArrayList keys = new ClusteredArrayList();

            if (Inverse)
            {
                sortAscending = false;
            }

            SortedList tmpList = new SortedList(new QueryResultComparer(sortAscending));

            IQueryResult temp = queryContext.InternalQueryResult;

            queryContext.InternalQueryResult = new Common.Queries.HashedQueryResult(queryContext.KeyFilter, queryContext.CompoundFilter);

            for (int i = 0; i < members.Count; i++)
            {
                Predicate           predicate  = (Predicate)members[i];
                CollectionOperation mergeTypeX = (Inverse == true || (queryContext.InternalQueryResult.Count == 0 & i == 0)) ? CollectionOperation.Union : CollectionOperation.Intersection;
                predicate.ExecuteInternal(queryContext, mergeTypeX);
            }
            queryContext.InternalQueryResult.Merge(temp, mergeType);
        }