Exemple #1
0
        internal static bool Compare(double x, bool y, RelationOperator op)
        {
            switch (op)
            {
            default:
                return(QueryValueModel.Compare(x, QueryValueModel.Double(y), op));

            case RelationOperator.Eq:
                return(QueryValueModel.Boolean(x) == y);

            case RelationOperator.Ne:
                return(QueryValueModel.Boolean(x) != y);
            }
        }
Exemple #2
0
        internal static bool Compare(bool x, double y, RelationOperator op)
        {
            switch (op)
            {
            default:
                return(QueryValueModel.Compare(QueryValueModel.Double(x), y, op));

            case RelationOperator.Eq:
                return(x == QueryValueModel.Boolean(y));

            case RelationOperator.Ne:
                return(x != QueryValueModel.Boolean(y));
            }
        }
Exemple #3
0
        internal static bool Compare(string x, bool y, RelationOperator op)
        {
            Fx.Assert(null != x, "");
            switch (op)
            {
            default:
                return(QueryValueModel.Compare(QueryValueModel.Double(x), QueryValueModel.Double(y), op));

            case RelationOperator.Eq:
                return(y == QueryValueModel.Boolean(x));

            case RelationOperator.Ne:
                return(y != QueryValueModel.Boolean(x));
            }
        }
Exemple #4
0
        internal bool ToBoolean()
        {
            switch (this.type)
            {
            case ValueDataType.Boolean:
                return(this.boolVal);

            case ValueDataType.Double:
                return(QueryValueModel.Boolean(this.dblVal));

            case ValueDataType.Sequence:
                return(QueryValueModel.Boolean(this.sequence));

            case ValueDataType.String:
                return(QueryValueModel.Boolean(this.strVal));
            }
            throw DiagnosticUtility.ExceptionUtility.ThrowHelperCritical(new QueryProcessingException(QueryProcessingError.TypeMismatch));
        }
        public bool GetResultAsBoolean()
        {
            switch (this.resultType)
            {
            case XPathResultType.Number:
                return(QueryValueModel.Boolean(this.numberResult));

            case XPathResultType.String:
                return(QueryValueModel.Boolean(this.stringResult));

            case XPathResultType.Boolean:
                return(this.boolResult);

            case XPathResultType.NodeSet:
                return(QueryValueModel.Boolean(this.nodeSetResult));
            }
            throw Fx.AssertAndThrow("Unexpected result type.");
        }
Exemple #6
0
 internal static bool Equals(bool x, double y)
 {
     return(x == QueryValueModel.Boolean(y));
 }
Exemple #7
0
 internal static bool Compare(NodeSequence x, bool y, RelationOperator op)
 {
     Fx.Assert(null != x, "");
     return(QueryValueModel.Compare(QueryValueModel.Boolean(x), y, op));
 }
Exemple #8
0
 internal static bool Compare(bool x, NodeSequence y, RelationOperator op)
 {
     Fx.Assert(null != y, "");
     return(QueryValueModel.Compare(x, QueryValueModel.Boolean(y), op));
 }