Exemple #1
0
            public override bool IsDataOk(ParadoxRecord dataRec)
            {
                var val  = dataRec.DataValues[this.DataFieldIndex];
                var comp = Comparer.Default.Compare(val, this.Value);

                switch (Operator)
                {
                case ParadoxCompareOperator.Equal:
                    return(comp == 0);

                case ParadoxCompareOperator.NotEqual:
                    return(comp != 0);

                case ParadoxCompareOperator.Greater:
                    return(comp > 0);

                case ParadoxCompareOperator.GreaterOrEqual:
                    return(comp >= 0);

                case ParadoxCompareOperator.Less:
                    return(comp < 0);

                case ParadoxCompareOperator.LessOrEqual:
                    return(comp <= 0);

                default:
                    throw new NotSupportedException();
                }
            }
Exemple #2
0
 public override bool IsDataOk(ParadoxRecord dataRec)
 {
     var val = dataRec.DataValues[this.DataFieldIndex];
     var comp = Comparer.Default.Compare(val, this.Value);
     switch (Operator)
     {
         case ParadoxCompareOperator.Equal:
             return comp == 0;
         case ParadoxCompareOperator.NotEqual:
             return comp != 0;
         case ParadoxCompareOperator.Greater:
             return comp > 0;
         case ParadoxCompareOperator.GreaterOrEqual:
             return comp >= 0;
         case ParadoxCompareOperator.Less:
             return comp < 0;
         case ParadoxCompareOperator.LessOrEqual:
             return comp <= 0;
         default:
             throw new NotSupportedException();
     }
 }
Exemple #3
0
            public override bool IsIndexPossible(ParadoxRecord indexRec, ParadoxRecord nextRec)
            {
                var val1  = indexRec.DataValues[this.IndexFieldIndex];
                var comp1 = Comparer.Default.Compare(val1, this.Value);
                int comp2;

                if (nextRec != null)
                {
                    var val2 = nextRec.DataValues[this.IndexFieldIndex];
                    comp2 = Comparer.Default.Compare(val2, this.Value);
                }
                else
                {
                    comp2 = 1; // last index range ends in infinite
                }
                switch (Operator)
                {
                case ParadoxCompareOperator.Equal:
                    return(comp1 <= 0 && comp2 >= 0);

                case ParadoxCompareOperator.NotEqual:
                    return(comp1 > 0 || comp2 < 0);

                case ParadoxCompareOperator.Greater:
                    return(comp2 > 0);

                case ParadoxCompareOperator.GreaterOrEqual:
                    return(comp2 >= 0);

                case ParadoxCompareOperator.Less:
                    return(comp1 < 0);

                case ParadoxCompareOperator.LessOrEqual:
                    return(comp1 <= 0);

                default:
                    throw new NotSupportedException();
                }
            }
Exemple #4
0
 public override bool IsIndexPossible(ParadoxRecord indexRec, ParadoxRecord nextRec)
 {
     return true;
 }
Exemple #5
0
 public override bool IsDataOk(ParadoxRecord dataRec)
 {
     return true;
 }
Exemple #6
0
 public override bool IsIndexPossible(ParadoxRecord indexRec, ParadoxRecord nextRec)
 {
     var val1 = indexRec.DataValues[this.IndexFieldIndex];
     var comp1 = Comparer.Default.Compare(val1, this.Value);
     int comp2;
     if (nextRec != null)
     {
         var val2 = nextRec.DataValues[this.IndexFieldIndex];
         comp2 = Comparer.Default.Compare(val2, this.Value);
     }
     else
     {
         comp2 = 1; // last index range ends in infinite
     }
     switch (Operator)
     {
         case ParadoxCompareOperator.Equal:
             return comp1 <= 0 && comp2 >= 0;
         case ParadoxCompareOperator.NotEqual:
             return comp1 > 0 || comp2 < 0;
         case ParadoxCompareOperator.Greater:
             return comp2 > 0;
         case ParadoxCompareOperator.GreaterOrEqual:
             return comp2 >= 0;
         case ParadoxCompareOperator.Less:
             return comp1 < 0;
         case ParadoxCompareOperator.LessOrEqual:
             return comp1 <= 0;
         default:
             throw new NotSupportedException();
     }
 }
Exemple #7
0
 public abstract bool IsIndexPossible(ParadoxRecord indexRec, ParadoxRecord nextRec);
Exemple #8
0
 public abstract bool IsDataOk(ParadoxRecord dataRec);
Exemple #9
0
 public override bool IsIndexPossible(ParadoxRecord indexRec, ParadoxRecord nextRec)
 {
     return this.Test(c => c.IsIndexPossible(indexRec, nextRec));
 }
Exemple #10
0
 public override bool IsDataOk(ParadoxRecord dataRec)
 {
     return this.Test(c => c.IsDataOk(dataRec));
 }
Exemple #11
0
 public abstract bool IsIndexPossible(ParadoxRecord indexRec, ParadoxRecord nextRec);
Exemple #12
0
 public abstract bool IsDataOk(ParadoxRecord dataRec);
Exemple #13
0
 public override bool IsIndexPossible(ParadoxRecord indexRec, ParadoxRecord nextRec)
 {
     return(this.Test(c => c.IsIndexPossible(indexRec, nextRec)));
 }
Exemple #14
0
 public override bool IsDataOk(ParadoxRecord dataRec)
 {
     return(this.Test(c => c.IsDataOk(dataRec)));
 }