public bool doubleExpresionResult(QueryExpression.Operator op, double gcValue, double conditionValue)
        {
            bool result = false;

            switch (op)
            {
            case QueryExpression.Operator.Equal:
                result = gcValue == conditionValue;
                break;

            case QueryExpression.Operator.Larger:
                result = gcValue.CompareTo(conditionValue) > 0;
                break;

            case QueryExpression.Operator.LargerOrEqual:
                result = gcValue.CompareTo(conditionValue) >= 0;
                break;

            case QueryExpression.Operator.Less:
                result = gcValue.CompareTo(conditionValue) < 0;
                break;

            case QueryExpression.Operator.LessOrEqual:
                result = gcValue.CompareTo(conditionValue) <= 0;
                break;

            case QueryExpression.Operator.NotEqual:
                result = gcValue.CompareTo(conditionValue) != 0;
                break;
            }
            return(result);
        }
        public override bool ExpressionResult(Framework.Data.Geocache gc, QueryExpression.Operator op, string condition)
        {
            int con = 0;

            if (!string.IsNullOrEmpty(condition))
            {
                int.TryParse(condition, out con);
            }
            return(intExpresionResult(op, gc.Favorites, con));
        }
 public override bool ExpressionResult(Framework.Data.Geocache gc, QueryExpression.Operator op, string condition)
 {
     QueryBuilderForm.FreeQuery fq = (from q in QueryBuilderForm.AvailableQueries where q.Name == condition select q).FirstOrDefault();
     if (fq == null)
     {
         return(false);
     }
     else
     {
         return(QueryBuilderForm.GetQueryResult(fq, gc));
     }
 }
        public override bool ExpressionResult(Framework.Data.Geocache gc, QueryExpression.Operator op, string condition)
        {
            bool con = false;

            if (!string.IsNullOrEmpty(condition))
            {
                try
                {
                    con = bool.Parse(condition);
                }
                catch
                {
                }
            }
            return(boolExpresionResult(op, gc.Locked, con));
        }
        public override bool ExpressionResult(Framework.Data.Geocache gc, QueryExpression.Operator op, string condition)
        {
            double con = 0.0;

            if (!string.IsNullOrEmpty(condition))
            {
                try
                {
                    con = Utils.Conversion.StringToDouble(condition);
                }
                catch
                {
                }
            }
            return(doubleExpresionResult(op, gc.Difficulty, con));
        }
        public override bool ExpressionResult(Framework.Data.Geocache gc, QueryExpression.Operator op, string condition)
        {
            double con  = 0.0;
            double dist = 0.0;

            if (!string.IsNullOrEmpty(condition))
            {
                try
                {
                    con  = Utils.Conversion.StringToDouble(condition);
                    dist = Utils.Calculus.CalculateDistance(gc, Core.CenterLocation).EllipsoidalDistance / 1000.0;
                }
                catch
                {
                }
            }
            return(doubleExpresionResult(op, dist, con));
        }
 public override bool ExpressionResult(Framework.Data.Geocache gc, QueryExpression.Operator op, string condition)
 {
     return(stringExpresionResult(op, gc.Container.Name, condition));
 }
 public override bool ExpressionResult(Framework.Data.Geocache gc, QueryExpression.Operator op, string condition)
 {
     return(stringExpresionResult(op, gc.Owner ?? "", condition ?? ""));
 }
 public virtual bool ExpressionResult(Framework.Data.Geocache gc, QueryExpression.Operator op, string condition)
 {
     return(false);
 }
 public override bool ExpressionResult(Framework.Data.Geocache gc, QueryExpression.Operator op, string condition)
 {
     return(stringExpresionResult(op, string.Format("{0}-{1}-{2}", gc.DataFromDate.Year, gc.DataFromDate.Month.ToString("00"), gc.DataFromDate.Day.ToString("00")), condition ?? ""));
 }