public FilterCondition(string fieldName, object value, FilterOperator @operator, LogicalOperator whereoperator) { FieldName = fieldName; Value = value; Operator = @operator; WhereOperator = whereoperator; }
/// <summary> /// Conveter o operador logico do telerik para operador logico da aplicação /// </summary> /// <param name="op">objeto operador do telerik</param> /// <returns>objeto contendo o operador logico da aplicação</returns> public static LogicalOperator ConvertFrom(FilterOperator op) { switch (op) { case FilterOperator.Contains: return LogicalOperator.Contains; case FilterOperator.EndsWith: return LogicalOperator.EndsWith; case FilterOperator.IsContainedIn: return LogicalOperator.IsContainedIn; case FilterOperator.IsEqualTo: return LogicalOperator.IsEqualTo; case FilterOperator.IsGreaterThan: return LogicalOperator.IsGreaterThan; case FilterOperator.IsGreaterThanOrEqualTo: return LogicalOperator.IsGreaterThanOrEqualTo; case FilterOperator.IsLessThan: return LogicalOperator.IsLessThan; case FilterOperator.IsLessThanOrEqualTo: return LogicalOperator.IsLessThanOrEqualTo; case FilterOperator.IsNotEqualTo: return LogicalOperator.IsNotEqualTo; case FilterOperator.StartsWith: return LogicalOperator.StartsWith; default: return LogicalOperator.IsEqualTo; } }
/// <summary> /// Initializes a new instance of the <see cref="FilterDescriptor"/> class. /// </summary> /// <param name="columnName">Name of the column.</param> /// <param name="fieldName">Name of the field.</param> /// <param name="filterOperator">The filter operator.</param> /// <param name="value">The value.</param> /// <param name="memberType">Type of the member.</param> public FilterDescriptor(string columnName, string fieldName, FilterOperator filterOperator, object value, Type memberType) { ColumnName = columnName; FieldName = fieldName; Operator = filterOperator; Value = value; MemberType = memberType; }
public static EventsPostFilter RSIRise(FilterOperator filterOperator, double value, int window, RetrieveEventDataDelegate FetchValueToCompare) { var retrievedData = FetchValueToCompare(); var prices = retrievedData.Item2; var instrumentString = retrievedData.Item1; var rsi = HelperMethods.CalculateRSI(prices.ToDifferences(replaceNanWith_: 0d), window); return new EventsChangePostFilter(PostFilterType.RSIRise, filterOperator, value, rsi, instrumentString, retrievedData); }
public EventsPostFilter(PostFilterType postFilter, FilterOperator filterOperator, double value, DatedDataCollectionGen<double> sourceCollections, string instrumentString, Tuple<string, DatedDataCollectionGen<double>> rawData) { _postFilter = postFilter; _filterOperator = filterOperator; valueToCompare = value; //FetchValueToCompare = fetchValueToCompare; this.sourceCollections = sourceCollections; _instrumentString = instrumentString; _rawData = rawData; }
public QueryFilter(string property, FilterOperator op, object value) { if (string.IsNullOrWhiteSpace(property)) throw new ArgumentNullException("property"); if (null == value) throw new ArgumentNullException("value"); PropertyName = property; Operator = op; Value = value; }
protected virtual void SetOperatorAndValue(FilterOperator filterOperator, object value) { FilterDescriptor descriptor = Descriptor.FilterDescriptors[Descriptor.FilterDescriptors.Count - 1] as FilterDescriptor; if (descriptor == null) { throw new InvalidCastException(); } descriptor.Operator = filterOperator; descriptor.Value = value; }
public EventsPostFilter SdDownMove(FilterOperator filterOperator, double value, int window, RetrieveEventDataDelegate FetchValueToCompare) { var retrievedData = FetchValueToCompare(); var prices = retrievedData.Item2; var instrumentString = retrievedData.Item1; // create a movment series with the diff based on window var diffSeries = prices.ToDifferences(window).GetSubValues(v => v > 0); var eventMovementSd = Statistics.Stdev(eventDates.Select(d => diffSeries.ValueOnDate(d)).ToArray()); PostFilterStatistic stat = null; return new MovementBeforeEventPostFilter(PostFilterType.DownMovement, filterOperator, value * eventMovementSd, diffSeries, instrumentString, retrievedData, stat); }
/// <summary> /// Displays the available areas in a tree view. /// </summary> public bool ShowDialog(ref FilterOperator filterOperator) { FilterOperatorCB.SelectedItem = filterOperator; // display the dialog. if (base.ShowDialog() != DialogResult.OK) { return false; } filterOperator = (FilterOperator)FilterOperatorCB.SelectedItem; return true; }
/// <summary> /// Displays the dialog. /// </summary> public bool ShowDialog(ref FilterOperator value) { OperatorCB.SelectedItem = value; if (ShowDialog() != DialogResult.OK) { return false; } value = (FilterOperator)OperatorCB.SelectedItem; return true; }
/// <summary> /// safe for Contains, StartsWith, Is Equal To, Is Not Equal To /// </summary> /// <param name="filterOperator"></param> /// <param name="logicalOperator"></param> /// <returns></returns> private string ConvertDescriptorOperator(FilterOperator filterOperator, string logicalOperator) { string result; switch (filterOperator) { case FilterOperator.IsEqualTo: result = string.Format("{{0}} == @{{1}} {0} ", logicalOperator); break; case FilterOperator.IsNotEqualTo: result = string.Format("{{0}} != @{{1}} {0} ", logicalOperator); break; case FilterOperator.IsGreaterThan: result = string.Format("{{0}} > @{{1}} {0} ", logicalOperator); break; case FilterOperator.IsGreaterThanOrEqualTo: result = string.Format("{{0}} >= @{{1}} {0} ", logicalOperator); break; case FilterOperator.IsLessThan: result = string.Format("{{0}} < @{{1}} {0} ", logicalOperator); break; case FilterOperator.IsLessThanOrEqualTo: result = string.Format("{{0}} <= @{{1}} {0} ", logicalOperator); break; default: result = string.Format("{{0}}.{0}(@{{1}}) {1} ", filterOperator.ToString(), logicalOperator); break; } return String.IsNullOrEmpty(logicalOperator) ? result.Trim() : result; }
public UserQueryFilterController(Field field, FilterOperator? filterOperator) : base(field, filterOperator) { }
/// <summary> /// Adds the filter rule to the internal list of filter rules which will be joined by logic AND operator. /// </summary> /// <param name="func">The entity member selector expression.</param> /// <param name="filterOperator">The filter operator.</param> /// <param name="value">The filter value.</param> public FilterSettingsBuilder <TEntity> AddFilterRule(LambdaExpression func, FilterOperator filterOperator, object value) { AddSigleRule(func, filterOperator, value); return(this); }
protected BaseQueryFilterController(Field field, FilterOperator? filterOperator) { Field = field; FilterOperator = filterOperator; }
public EqualNotEqualFilter(FilterOperator op) : base(op) { ValidateOperator(); }
public static IQueryable <T1> Filter <T1, T2>(this IQueryable <T1> source, IEnumerable <T2> values, string fieldName, FilterOperator filterOperator, FilterLogic filterLogic) { return(source.Filter(values.ToFilterRequest(fieldName, filterOperator, filterLogic))); }
private Expression SerializeValue(object value, Property property, FilterOperator op) { var serialized = SearchFilter.GetValue(property, op, value); return(Expression.Constant(serialized)); }
private Expression SerializeMember(MemberExpression member, Property property, FilterOperator op) { var getValue = typeof(SearchFilter).GetMethod("GetValue", BindingFlags.NonPublic | BindingFlags.Static); Expression call = Expression.Call( getValue, Expression.Constant(property, typeof(Property?)), //Property Expression.Constant(op), CastValueType(member), //value Expression.Constant(FilterMode.Illegal) //FilterMode ); return(ExpressionHelpers.NullConditional(member, call)); }
protected FilterParamIndexEqualsBase(ExprFilterSpecLookupable lookupable, IReaderWriterLock readWriteLock, FilterOperator filterOperator) : base(filterOperator, lookupable) { ConstantsMap = new Dictionary <object, EventEvaluator>().WithNullKeySupport(); ConstantsMapRwLock = readWriteLock; }
public void Should_Return_Users_Records_With_Any_Matching_Value(string columnName, FilterOperator filterOperator, string columnValue) { // Arrange var filterCriteria = new FilterCriteria() { Options = new List <Filter> { new Filter { Name = columnName, Operator = filterOperator, Value = columnValue } } }; // Act var results = userList .ToPaged(filterCriteria) .ToList(); // Assert Assert.IsNotNull(results); Assert.IsNotEmpty(results); Assert.True(results.Any(u => u.LastName.Contains(columnValue)) || results.Any(u => u.PhoneNumber.Contains(columnValue))); }
private string getOperatorString(FilterOperator filterOperator) { string op; switch (filterOperator) { case FilterOperator.Undefined: op = String.Empty; break; case FilterOperator.LessThan: op = "<"; break; case FilterOperator.LessThanOrEqual: op = "<="; break; case FilterOperator.GreaterThan: op = ">"; break; case FilterOperator.GreaterThanOrEqual: op = ">="; break; case FilterOperator.Equals: op = "="; break; case FilterOperator.Like: op = String.Empty; break; default: op = String.Empty; break; } return op; }
/// <summary> /// Adds the filter rule to the internal list of filter rules which will be joined by logic AND operator. /// </summary> /// <typeparam name="TKey">The type of the key.</typeparam> /// <param name="func">The entity member selector expression.</param> /// <param name="filterOperator">The filter operator.</param> /// <param name="value">The filter value.</param> public FilterSettingsBuilder <TEntity> AddFilterRule <TKey>(Expression <Func <TEntity, TKey> > func, FilterOperator filterOperator, object value) { return(AddFilterRule((LambdaExpression)func, filterOperator, value)); }
/// <summary> /// Initializes a new instance of the <see cref="SearchFilter"/> class with a specified property, operator and value. /// </summary> /// <param name="property">Property to filter on.</param> /// <param name="operator">Operator to use to filter <paramref name="property"/> with <paramref name="value"/></param> /// <param name="value">Value to filter on.</param> public SearchFilter(Property property, FilterOperator @operator, object value) : this(property, @operator, value, FilterMode.Normal) { }
internal static string ToString(string parameter, FilterOperator @operator, object value, Property?property, FilterMode filterMode) { var format = $"{parameter}={GetOperatorFormat(property, value, @operator, filterMode)}"; return(format); }
public static IFilterRequest ToFilterRequest <T>(this IEnumerable <T> values, string fieldName, FilterOperator filterOperator, FilterLogic filterLogic) { return(new FilterRequest { Filters = values.ToFilters(fieldName, filterOperator), Logic = filterLogic }); }
public static IEnumerable <IFilter> ToFilters <T>(this IEnumerable <T> values, string fieldName, FilterOperator filterOperator) { var list = new List <IFilter>(); foreach (T value in values) { list.Add(new Filter { Field = fieldName, Operator = filterOperator, Value = value.ToString() }); } return(list); }
/// <summary> /// Private method handles parsing filter from string based on inputs /// </summary> /// <param name="filterString">full filter string</param> /// <param name="workingString">working string pared down from filter string</param> /// <param name="opVal">operator value - equals or not equals</param> /// <returns></returns> private static Filter parseFilterFromString(string workingString, FilterOperator filterOp) { Filter retVal = null; string opVal = getOpSign(filterOp); workingString = workingString.Replace(opVal, "Þ"); string[] filterTestSplit = workingString.Split('Þ'); if (filterTestSplit.Length == 2) { retVal = new Filter(filterTestSplit[0], filterOp, filterTestSplit[1]); } else if (filterTestSplit.Length > 2) { throw new ArgumentException("Cannot parse filter'" + workingString + "'. There are too many " + opVal + " symbols"); } return retVal; }
public FileDateModifiedFilter(DateTime date, FilterOperator op) : base(op) { modifiedTimes.Add(date); }
/// <summary> /// Sets the list box. /// </summary> /// <param name="lbx">The LBX.</param> /// <param name="filterOperator">The filter operator.</param> private void SetListBox(ListBox lbx, FilterOperator filterOperator) { lbx.SelectedIndex = (int)filterOperator; }
public FilterParamIndexDoubleRangeInverted(FilterSpecLookupable lookupable, IReaderWriterLock readWriteLock, FilterOperator filterOperator) : base(lookupable, readWriteLock, filterOperator) { if (!(filterOperator.IsInvertedRangeOperator())) { throw new ArgumentException("Invalid filter operator " + filterOperator); } }
private static void VisitBinaryMemberAccess(AttributeBuilder builder, BinaryExpression binary, FilterOperator filterOperator) { Expression valueExpression = null; var memberExpression = GetMemberAccessExpression(builder, binary.Left); if (memberExpression == null) { valueExpression = binary.Left; memberExpression = GetMemberAccessExpression(builder, binary.Right); if (memberExpression == null) { // no member was found..so assume one of the values is an attribute name. var attributeName = Expression.Lambda(binary.Left).Compile().DynamicInvoke(); var attributeValue = Expression.Lambda(binary.Right).Compile().DynamicInvoke(); builder.AddAttribute(Convert.ToString(attributeName), filterOperator, EscapeCharacters(attributeValue)); return; } } else { valueExpression = binary.Right; } var value = Expression.Lambda(valueExpression).Compile().DynamicInvoke(); builder.AddAttribute(GetName(memberExpression.Member), filterOperator, EscapeCharacters(value)); }
private FirstChar(Char?value, FilterOperator filterOperator) : base(value ?? Char.ToLower(value.Value), filterOperator) // May cause problems? { this.CanBeNull = true; }
public static string ToToken(this FilterOperator filterOperator) { return(operatorToToken[filterOperator]); }
private Released(SimpleDate value, FilterOperator filterOperator) : base(value.ToString().Quote(), filterOperator) { this.CanBeNull = true; }
internal Id(UInt32[] value, FilterOperator filterOperator) : base(value, filterOperator) { }
private Languages(String[] value, FilterOperator filterOperator) : base(value, filterOperator) { this.CanBeNull = true; }
private static string GetFilterOperator(FilterOperator filterOperator) { switch (filterOperator) { case FilterOperator.Equals: return "="; default: throw new ArgumentOutOfRangeException(); } }
public OriginalName(String value, FilterOperator filterOperator) : base(value, filterOperator) { this.CanBeNull = true; }
public LogFilter(FilterOperator Op, object value, FilterSection section) { Oper = Op; Value = value; Sect = section; }
private OriginalLanguage(String[] value, FilterOperator filterOperator) : base(value, filterOperator) { }
public MembershipQueryFilterController(Field field, FilterOperator? filterOperator) : base(field, filterOperator) { }
private Platforms(String[] value, FilterOperator filterOperator) : base(value, filterOperator) { this.CanBeNull = true; }
public Filter(FilterOperator op, string field, string value) { this.Operator = op; this.Field = field; this.Value = value; }
private Search(String value, FilterOperator filterOperator) : base(value, filterOperator) { }
private IFilterDescriptor CreateLinkedItemsFilter(FilterOperator filterOperator, IEnumerable<int> ids) { return new FilterDescriptor( AdoHelper.GetTableQualifiedColumnName(ReferencedProcessName, Constants.IdColumnName), filterOperator, ids.ToArray(), typeof(IInfoClass)); }
partial void Changed_Operator(FilterOperator oldValue, FilterOperator newValue);
/// <summary> /// Private method gets string representation of the current Operator value /// </summary> /// <returns>string representation of this.Operator</returns> private static string getOpSign(FilterOperator filterOp) { string retVal = string.Empty; switch (filterOp) { case FilterOperator.Equal: retVal = "=="; break; case FilterOperator.NotEqual: retVal = "<>"; break; default: break; } return retVal; }
public static string ToString(FilterOperator value) { if( value==FilterOperator.Equal ) return "="; else if( value==FilterOperator.IsA ) return "is-a"; else if( value==FilterOperator.IsNotA ) return "is-not-a"; else if( value==FilterOperator.Regex ) return "regex"; else throw new ArgumentException("Unrecognized FilterOperator value: " + value.ToString()); }
/// <summary> /// Creates a new instance of a filter /// </summary> /// <param name="key">name of the field to filter on</param> /// <param name="filterType">Equal or NotEqual</param> /// <param name="value">value to use for filtering</param> public Filter(string key, FilterOperator filterType, string value) { this.Key = key; this.Value = value; this.Operator = filterType; }
/// <summary> /// Pushes a new element onto the stack. /// </summary> /// <param name="op">The filter operator.</param> /// <param name="operands">The operands.</param> /// <returns></returns> public ContentFilterElement Push(FilterOperator op, params object[] operands) { // check if nothing more to do. if (operands == null || operands.Length == 0) { throw ServiceResultException.Create(StatusCodes.BadInvalidArgument, "ContentFilterElement does not have an operands."); } // create the element and set the operator. ContentFilterElement element = new ContentFilterElement(); element.FilterOperator = op; for (int ii = 0; ii < operands.Length; ii++) { // check if a FilterOperand was provided. FilterOperand filterOperand = operands[ii] as FilterOperand; if (filterOperand != null) { element.FilterOperands.Add(new ExtensionObject(filterOperand)); continue; } // check for reference to another ContentFilterElement. ContentFilterElement existingElement = operands[ii] as ContentFilterElement; if (existingElement != null) { int index = FindElementIndex(existingElement); if (index == -1) { throw ServiceResultException.Create(StatusCodes.BadInvalidArgument, "ContentFilterElement is not part of the ContentFilter."); } ElementOperand operand = new ElementOperand(); operand.Index = (uint)index; element.FilterOperands.Add(new ExtensionObject(operand)); continue; } // assume a literal operand. LiteralOperand literalOperand = new LiteralOperand(); literalOperand.Value = new Variant(operands[ii]); element.FilterOperands.Add(new ExtensionObject(literalOperand)); } // insert the new element at the begining of the list. m_elements.Insert(0, element); // re-number ElementOperands since all element were shifted up. for (int ii = 0; ii < m_elements.Count; ii++) { foreach (ExtensionObject extension in m_elements[ii].FilterOperands) { if (extension != null) { ElementOperand operand = extension.Body as ElementOperand; if (operand != null) { operand.Index++; } } } } // return new element. return element; }
public FilterData( FilterOperator Operator, FilterType Type, String ValuePropertyBindingPath, Type ValuePropertyType, String QueryString, String QueryStringTo, bool IsTypeInitialized, bool IsCaseSensitiveSearch ) { this.Operator = Operator; this.Type = Type; this.ValuePropertyBindingPath = ValuePropertyBindingPath; this.ValuePropertyType = ValuePropertyType; this.QueryString = QueryString; this.QueryStringTo = QueryStringTo; this.IsTypeInitialized = IsTypeInitialized; this.IsCaseSensitiveSearch = IsCaseSensitiveSearch; }
public override T VisitFilterOperator(FilterOperator node) { throw new NotImplementedException(); }
private Tags(Int32[] value, FilterOperator filterOperator) : base(value, filterOperator) { }
private static void VisitMethodCall(AttributeBuilder builder, MethodCallExpression method, Expression valueExpression, FilterOperator filterOperator) { var value = Expression.Lambda(valueExpression).Compile().DynamicInvoke(); var memberExpression = GetMemberAccessExpression(builder, method.Object); builder.AddAttribute(GetName(memberExpression.Member), filterOperator, value); }
// -------------------------------------------------------------------- partial void Coerce_Operator(FilterOperator value, ref FilterOperator coercedValue);
private Traits(UInt32[] value, FilterOperator filterOperator) : base(value, filterOperator) { }
public static bool TryParse(string value, out FilterOperator result) { result = default(FilterOperator); if( value=="=") result = FilterOperator.Equal; else if( value=="is-a") result = FilterOperator.IsA; else if( value=="is-not-a") result = FilterOperator.IsNotA; else if( value=="regex") result = FilterOperator.Regex; else return false; return true; }
private Name(String value, FilterOperator filterOperator) : base(value, filterOperator) { }
public FilterDescriptor(string member, FilterOperator filterOperator, object filterValue) { this.Member = member; this.Operator = filterOperator; this.Value = filterValue; }
private Username(String[] value, FilterOperator filterOperator) : base(value, filterOperator) { }