Example #1
0
 public FilterPredicate(
     FilterExpression.BinaryOperation binaryOperator,
     GridKnownFunction function)
 {
     this.binaryOperator = binaryOperator;
     this.function       = function;
     this.filterFunction = FilterFunction.GetFilterFunction(this.function);
 }
Example #2
0
 protected override void ProcessPropertyChanged(PropertyChangedEventArgs e)
 {
     switch (e.PropertyName)
     {
     case "Function":
         this.filterFunction = FilterFunction.GetFilterFunction(this.function);
         break;
     }
 }
Example #3
0
 public static FilterFunction GetDefaultFunctionForType(Type type)
 {
     Dictionary <GridKnownFunction, FilterFunction> .Enumerator enumerator = FilterFunction.functionDictionary.GetEnumerator();
     while (enumerator.MoveNext())
     {
         FilterFunction filterFunction = enumerator.Current.Value;
         if (filterFunction != null && filterFunction.IsDefaultForType(type))
         {
             return(filterFunction);
         }
     }
     return(FilterFunction.functionDictionary[GridKnownFunction.NoFilter]);
 }
Example #4
0
        public static List <FilterFunction> GetApplicableFunctionsForType(Type type)
        {
            List <FilterFunction> filterFunctionList = new List <FilterFunction>();

            Dictionary <GridKnownFunction, FilterFunction> .Enumerator enumerator = FilterFunction.functionDictionary.GetEnumerator();
            while (enumerator.MoveNext())
            {
                FilterFunction filterFunction = enumerator.Current.Value;
                if (filterFunction.IsApplicableForType(type))
                {
                    filterFunctionList.Add(filterFunction);
                }
            }
            return(filterFunctionList);
        }
Example #5
0
        static FilterFunction()
        {
            FilterFunction.quotedValueFormatStrings = new Dictionary <Type, string>();
            FilterFunction.quotedValueFormatStrings.Add(typeof(string), "'{0}'");
            FilterFunction.quotedValueFormatStrings.Add(typeof(TimeSpan), "'{0}'");
            FilterFunction.quotedValueFormatStrings.Add(typeof(byte[]), "'{0}'");
            FilterFunction.quotedValueFormatStrings.Add(typeof(bool), "'{0}'");
            FilterFunction.quotedValueFormatStrings.Add(typeof(DateTime), "#{0}#");
            FilterFunction.functionDictionary = new Dictionary <GridKnownFunction, FilterFunction>();
            Array values = Enum.GetValues(typeof(GridKnownFunction));

            for (int index = 0; index < values.Length; ++index)
            {
                FilterFunction.GetFilterFunction((GridKnownFunction)values.GetValue(index));
            }
        }
Example #6
0
 public FilterPredicate()
 {
     this.filterFunction = FilterFunction.GetFilterFunction(this.function);
 }