Esempio n. 1
0
        public IEnumerable<SearchConditionReference> EnumerateConditions()
        {
            //*** This goes to the SkyQueryJob and the Condition normalizer
            // TODO: this has to be updated to handle non conjunctive normal form predicates too
            WhereClause wh = FindDescendant<WhereClause>();

            if (wh == null)
            {
                yield break;
            }
            else
            {
                SearchCondition sc = wh.FindDescendant<SearchCondition>();
                if (sc == null)
                {
                    yield break;
                }
                else
                {
                    foreach (object n in sc.Nodes)
                    {
                        SearchConditionReference wc;
                        if (n is Predicate)
                        {
                            wc = new SearchConditionReference((Predicate)n);
                            yield return wc;
                        }
                        else if (n is SearchConditionBrackets)
                        {
                            wc = new SearchConditionReference((SearchConditionBrackets)n);
                            yield return wc;
                        }
                    }
                }
            }
        }
        public IEnumerable <SearchConditionReference> EnumerateConditions()
        {
            //*** This goes to the SkyQueryJob and the Condition normalizer
            // TODO: this has to be updated to handle non conjunctive normal form predicates too
            WhereClause wh = FindDescendant <WhereClause>();

            if (wh == null)
            {
                yield break;
            }
            else
            {
                SearchCondition sc = wh.FindDescendant <SearchCondition>();
                if (sc == null)
                {
                    yield break;
                }
                else
                {
                    foreach (object n in sc.Nodes)
                    {
                        SearchConditionReference wc;
                        if (n is Predicate)
                        {
                            wc = new SearchConditionReference((Predicate)n);
                            yield return(wc);
                        }
                        else if (n is SearchConditionBrackets)
                        {
                            wc = new SearchConditionReference((SearchConditionBrackets)n);
                            yield return(wc);
                        }
                    }
                }
            }
        }