public void Process(CriteriaOperator operand, bool mustBeLogical) { if (ReferenceEquals(operand, null)) return; if (mustBeLogical) { if ((BooleanCriteriaState)operand.Accept(this) == BooleanCriteriaState.Value) throw new ArgumentException(MustBeLogical); } else { if ((BooleanCriteriaState)operand.Accept(this) == BooleanCriteriaState.Logical) throw new ArgumentException(MustBeArithmetical); } }
public void Process(CriteriaOperator criteria) { if (!ReferenceEquals(criteria, null)) { criteria.Accept(this); } }
private OperandValue GetCustomFunctionOperandValue(CriteriaOperator theOperator) { var functionOperator = theOperator as FunctionOperator; return(!ReferenceEquals(functionOperator, null)? (functionOperator.OperatorType == FunctionOperatorType.Custom ? new OperandValue(theOperator.Accept(this)): null): null); }
public CriteriaOperator ReplaceCriteriaByFieldName(List <string> fieldsToReplace, CriteriaOperator op) { if (fieldsToReplace.Count == 0) { return(null); } this.fieldsToReplace = fieldsToReplace; return(op.Accept <CriteriaOperator>(this)); }
private static CriteriaOperator ValidatePrefilterCriteria(CriteriaOperator criteria) { if (ReferenceEquals(criteria, null)) { return(null); } var validator = new FilterValidator(); return(criteria.Accept(validator) as CriteriaOperator); }
internal IList GetDataSource(object forObject) { CriteriaOperator criteria = null; if (Properties == null) { return(null); } IList propertyDataSource = (Properties.DataSourceMemberInfo != null) && (GridEditingObject != null) ? Properties.DataSourceMemberInfo.GetValue(forObject) as IList : null; IList dataSource = new List <ImageComboBoxItem>(); if (propertyDataSource == null) { for (int i = 0; i < Properties.Items.Count; i++) { dataSource.Add(Properties.Items[i]); } } else { for (int i = 0; i < Properties.Items.Count; i++) { ImageComboBoxItem item = Properties.Items[i]; if (propertyDataSource.Contains(item.Value)) { dataSource.Add(item); } } } string criteriaString = Properties.Model.DataSourceCriteria; if (!String.IsNullOrEmpty(criteriaString)) { criteria = CriteriaOperator.Parse(criteriaString); } if (!ReferenceEquals(criteria, null)) { criteria.Accept(new EnumCriteriaParser( Properties.PropertyMemberInfo.Name, Properties.PropertyMemberInfo.MemberType)); ICollection filteredDataSource = new ExpressionEvaluator(ImageComboBoxItemProperties, criteria, true).Filter(dataSource); dataSource.Clear(); foreach (ImageComboBoxItem item in filteredDataSource) { dataSource.Add(item); } } return(dataSource); }
IEnumerable GetDataSource() { IEnumerable dataSource = null; if (_dataSourceProperty != null) { dataSource = _dataSourceProperty.GetValue(CurrentObject, null) as IEnumerable; if (dataSource != null) { bool hasItems = (dataSource).GetEnumerator().MoveNext(); if (!hasItems) { dataSource = null; } } } if (dataSource == null) { if (string.IsNullOrEmpty(_isNullCriteria)) { if (_isNullMode == DataSourcePropertyIsNullMode.SelectAll) { return(descriptor.Values); } if (_isNullMode == DataSourcePropertyIsNullMode.SelectNothing) { return(null); } } else { CriteriaOperator criteriaOperator = CriteriaOperator.Parse(_isNullCriteria); if (!ReferenceEquals(criteriaOperator, null)) { dataSource = new List <object>(); foreach (object item in descriptor.Values) { ((IList)dataSource).Add(CreateEditItem(item)); } criteriaOperator.Accept(new EnumCriteriaParser(PropertyName, _propertyType)); var filteredDataSource = new ExpressionEvaluator(PropertyDescriptorCollection, criteriaOperator, true).Filter(dataSource); ((IList)dataSource).Clear(); foreach (ListEditItem item in filteredDataSource) { ((IList)dataSource).Add(item); } } } } return(dataSource); }
public BooleanCriteriaState Process(CriteriaOperator operand) { if(ReferenceEquals(operand, null)) return BooleanCriteriaState.Logical; return (BooleanCriteriaState)operand.Accept(this); }
public void Validate(CriteriaOperator criteria) { if(!ReferenceEquals(criteria, null)) criteria.Accept(this); }
protected object Process(CriteriaOperator operand) { if(ReferenceEquals(operand, null)) return null; object value = operand.Accept(this); return FixValue(value); }
private CriteriaOperator Process(CriteriaOperator operand) { if (!ReferenceEquals(operand, null)) return (CriteriaOperator)operand.Accept(this); return null; }
private void Process(CriteriaOperator operand) { if (!ReferenceEquals(operand, null)) operand.Accept(this); }
private OperandValue GetCustomFunctionOperandValue(CriteriaOperator theOperator){ var functionOperator = theOperator as FunctionOperator; return !ReferenceEquals(functionOperator,null)? (functionOperator.OperatorType == FunctionOperatorType.Custom ? new OperandValue(theOperator.Accept(this)): null): null; }
private object Accept(CriteriaOperator criteriaOperator) { if (ReferenceEquals(criteriaOperator, null)) { return null; } object value = criteriaOperator.Accept(this); return value == DBNull.Value ? null : value; }
public static object Process(CriteriaOperator op, List<XPMemberInfo> memberInfos) { return op.Accept(new FullTextOperatorProcessor(memberInfos)) ; }
public static object Process(CriteriaOperator op, IEnumerable <XPMemberInfo> memberInfos) { return(op.Accept(new FullTextOperatorProcessor(memberInfos))); }
public static string Process(CriteriaOperator op) { return(op.Accept(new CustomCriteriaToLinqWhereParser()).ToString()); }
// Возвращает формат агрегированного значения указанного выражения public static string GetSelectValue(CriteriaOperator aggregateProperty, Aggregate aggregate, SelectSqlGeneratorBase generator) { string property = ReferenceEquals(aggregateProperty, null) ? "*" : (string)aggregateProperty.Accept(generator); return String.Format(agg[(int)aggregate], property); }