Esempio n. 1
0
        /// <summary>Loads this supports query from the given CSS value between the given set indices.</summary>
        public static SupportsQuery Load(Value value, int start, int endInclusive)
        {
            // Got anything?
            if (start == endInclusive)
            {
                // Act like 'all' was declared by clearing the things to match:
                return(new SupportsQuery());
            }

            // From start to end (inclusive), read the keywords
            // (property:value) are ValueSet instances
            SupportsQuery        result  = null;
            List <SupportsQuery> results = null;

            for (int i = start; i <= endInclusive; i++)
            {
                // Put the value into context:
                SupportsQuery section = LoadSection(value, ref i, endInclusive);

                if (section == null)
                {
                    continue;
                }

                if (result == null)
                {
                    result = section;
                }
                else
                {
                    if (results == null)
                    {
                        // Create set:
                        results = new List <SupportsQuery>();
                        results.Add(result);
                    }

                    results.Add(section);
                }
            }

            if (results != null)
            {
                // Multiple results.
                return(new SupportsQueryList(results.ToArray()));
            }

            return(result);
        }
Esempio n. 2
0
        /// <summary>Used by JS.</summary>
        public SupportsQueryList(ReflowDocument doc, SupportsQuery q)
        {
            // Pull the query set from the supports query, if it is a set:
            if (!(q is SupportsQueryList))
            {
                // Just the one query.
                Queries = new SupportsQuery[] { q };
                return;
            }

            // Pull the set out:
            SupportsQueryList list = q as SupportsQueryList;

            Queries = list.Queries;
        }
Esempio n. 3
0
 public SupportsQueryNot(SupportsQuery input)
 {
     Input1 = input;
 }
Esempio n. 4
0
 public SupportsQueryAnd(SupportsQuery in1, SupportsQuery in2)
 {
     Input1 = in1;
     Input2 = in2;
 }