public FilterPredicate( FilterExpression.BinaryOperation binaryOperator, GridKnownFunction function) { this.binaryOperator = binaryOperator; this.function = function; this.filterFunction = FilterFunction.GetFilterFunction(this.function); }
protected override void ProcessPropertyChanged(PropertyChangedEventArgs e) { switch (e.PropertyName) { case "Function": this.filterFunction = FilterFunction.GetFilterFunction(this.function); break; } }
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]); }
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); }
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)); } }
public FilterPredicate() { this.filterFunction = FilterFunction.GetFilterFunction(this.function); }