System.Xml.Xsl.XmlQueryCardinality.AtMost C# (CSharp) Method

AtMost() public method

Compute the cardinality of a subset of a set of the given cardinality.
public AtMost ( ) : XmlQueryCardinality
return XmlQueryCardinality
        public XmlQueryCardinality AtMost() {
            //  Fill downward to zero
            return new XmlQueryCardinality(this.value | (this.value >> 1) | (this.value >> 2));
        }

Usage Example

 /// <summary>
 /// Compute a sequence of zero to some max cardinality.
 /// </summary>
 /// <param name="t">the type to sequence</param>
 /// <param name="c">the upper bound</param>
 /// <returns>the sequence of t from 0 to c</returns>
 public static XmlQueryType AtMost(XmlQueryType t, XmlQueryCardinality c) {
     return PrimeProduct(t, c.AtMost());
 }