本文整理汇总了C#中CriteriaOperator类的典型用法代码示例。如果您正苦于以下问题:C# CriteriaOperator类的具体用法?C# CriteriaOperator怎么用?C# CriteriaOperator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CriteriaOperator类属于命名空间,在下文中一共展示了CriteriaOperator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: TranslateCriteriaOperator
public static string TranslateCriteriaOperator(CriteriaOperator criteriaOperator)
{
if (criteriaOperator == CriteriaOperator.Equal)
return "=";
if (criteriaOperator == CriteriaOperator.NotEqual)
return "<>";
if (criteriaOperator == CriteriaOperator.GreaterThan)
return ">";
if (criteriaOperator == CriteriaOperator.GreaterThanOrEqual)
return ">=";
if (criteriaOperator == CriteriaOperator.LesserThan)
return "<";
if (criteriaOperator == CriteriaOperator.LesserThanOrEqual)
return "<=";
if (criteriaOperator == CriteriaOperator.Like)
return " LIKE ";
if (criteriaOperator == CriteriaOperator.NotLike)
return " NOT LIKE ";
if (criteriaOperator == CriteriaOperator.IsNull)
return " IS NULL ";
if (criteriaOperator == CriteriaOperator.IsNotNull)
return " IS NOT NULL ";
throw new ArgumentException("CriteriaOperator not supported", "criteriaOperator");
}
开发者ID:lcomplete,项目名称:Iridescent,代码行数:25,代码来源:SqlServerQueryTranslator.cs
示例2: Criteria
public Criteria(String propertyName, String value, CriteriaOperator criteriaOperator, LogicalOperation logicalOperation = Core.Query.LogicalOperation.And)
{
this.PropertyName = propertyName;
this.Value = value;
this.Operator = criteriaOperator;
this.LogicalOperation = logicalOperation;
}
开发者ID:nxlibing,项目名称:managesystem,代码行数:7,代码来源:Criteria.cs
示例3: Criterion
public Criterion(string fieldName, string parameterName, object parameterValue, CriteriaOperator criterriaOperator)
{
_fieldName = fieldName;
_parameterName = parameterName;
_parameterValue = parameterValue;
_criteriaOperator = criterriaOperator;
}
开发者ID:nxjcproject,项目名称:nxjc,代码行数:7,代码来源:Criterion.cs
示例4: ApplyCustomFilter
private void ApplyCustomFilter()
{
if (Frame.View == null)
return;
switch (Frame.View.Id)
{
case "WHHistory_ListView_ThisMonth":
DateTime thisMonth;
thisMonth = DateTime.Today;
thisMonth = thisMonth.AddDays((thisMonth.Day -1) * -1);
criteria = CriteriaOperator.Parse(string.Format("Date >= '{0}'", thisMonth));
break;
case "WHHistory_ListView_ThisWeek":
criteria = CriteriaOperator.Parse(string.Format("Date >= '{0}'", DateTime.Today.AddDays(-7)));
break;
case "WHHistory_ListView_ThisYear":
DateTime thisYear;
thisYear = DateTime.Today;
thisYear = thisYear.AddMonths((thisYear.Month - 1) * -1);
thisYear = thisYear.AddDays((thisYear.Day -1 )* -1);
criteria = CriteriaOperator.Parse(string.Format("Date >= '{0}'", thisYear));
break;
case "WHHistory_ListView":
criteria = null;
break;
}
((ListView)Frame.View).CollectionSource.Criteria["MyFilter"] = criteria;
}
开发者ID:kamchung322,项目名称:Namwah,代码行数:31,代码来源:WHHistory_View.cs
示例5: CreateFilterCriteria
CriteriaOperator CreateFilterCriteria()
{
if (!Filter_words)
{ // точное совпадение
CriteriaOperator[] operators = new CriteriaOperator[_View.VisibleColumns.Count];
for (int i = 0; i < _View.VisibleColumns.Count; i++)
{
if (Filter_Plus)
operators[i] = new BinaryOperator(_View.VisibleColumns[i].FieldName, String.Format("%{0}%", _ActiveFilter), BinaryOperatorType.Like);
else
operators[i] = new BinaryOperator(_View.VisibleColumns[i].FieldName, String.Format("{0}%", _ActiveFilter), BinaryOperatorType.Like);
}
return new GroupOperator(GroupOperatorType.Or, operators);
}
else
{ // любое слово
CriteriaOperator[] levels = new CriteriaOperator[FilterText.Length];
for (int i = 0; i < FilterText.Length; i++)
{
CriteriaOperator[] operators = new CriteriaOperator[_View.VisibleColumns.Count + 1]; // Тэги + 1
for (int j = 0; j < _View.VisibleColumns.Count; j++)
{
operators[j] = new BinaryOperator(_View.VisibleColumns[j].FieldName, String.Format("%{0}%", FilterText[i]), BinaryOperatorType.Like);
}
// Тэги
operators[_View.VisibleColumns.Count] = new BinaryOperator("TagComments", String.Format("%{0}%", FilterText[i]), BinaryOperatorType.Like);
levels[i] = new GroupOperator(GroupOperatorType.Or, operators);
}
return new GroupOperator(GroupOperatorType.And, levels);
}
}
开发者ID:toxig,项目名称:ParnasPlayer,代码行数:33,代码来源:GridViewFilter.cs
示例6: MasterDetailRuleInfo
public MasterDetailRuleInfo(IModelListView childListView, IModelMember collectionMember, ITypeInfo typeInfo, CriteriaOperator criteria, bool synchronizeActions) {
ChildListView = childListView;
CollectionMember = collectionMember;
TypeInfo = typeInfo;
_criteria = criteria;
_synchronizeActions = synchronizeActions;
}
开发者ID:dimajanzen,项目名称:eXpand,代码行数:7,代码来源:MasterDetailRuleInfo.cs
示例7: PrepareCriteria
public CriteriaOperator PrepareCriteria(CriteriaOperator op)
{
if (op is FunctionOperator)
{
var funcOp = new FunctionOperator();
for (int i = 0; i < (op as FunctionOperator).Operands.Count; i++)
funcOp.Operands.Add(PrepareCriteria((op as FunctionOperator).Operands[i]));
return funcOp;
}
else if (op is ConstantValue)
{
var cnst = new ConstantValue((op as ConstantValue).Value);
if (String.Concat((op as ConstantValue).Value).ToLower().IndexOf("@this") > -1)
{
IMemberInfo info;
cnst.Value = ObjectFormatValues.GetValueRecursive((op as ConstantValue).Value.ToString().Replace("@This.", "").Replace("@This", "").Replace("@this.", "").Replace("@this", ""), CurrentObject, out info);
}
return cnst;
}
else if (op is BinaryOperator)
{
var binary = new BinaryOperator();
binary.LeftOperand = PrepareCriteria((op as BinaryOperator).LeftOperand);
binary.RightOperand = PrepareCriteria((op as BinaryOperator).RightOperand);
return binary;
}
else
{
return op;
}
}
开发者ID:Terricks,项目名称:XAFBootstrap,代码行数:31,代码来源:XafBootstrapTagPropertyEditor.cs
示例8: Criterion
/// <summary>
/// Initializes a new instance of the Idiorm.Criterion class that uses the property name, the value and the operator of the new Idiorm.Criterion.
/// </summary>
/// <param name="propertyName">The name of the property to map.</param>
/// <param name="operator">The operator of the new Idiorm.Criterion object.</param>
/// <param name="value">The value of the new Idiorm.Criterion object.</param>
public Criterion(string propertyName, CriteriaOperator @operator, object value)
: this()
{
this.propertyName = propertyName;
this.value = value;
[email protected] = @operator;
}
开发者ID:ikelos555,项目名称:HSROrderApp,代码行数:13,代码来源:Criterion.cs
示例9: getGroupOperator
private static BinaryOperator getGroupOperator(out BinaryOperator binaryOperator2,
out CriteriaOperator groupOperator)
{
var binaryOperator = new BinaryOperator("dfs", 324);
binaryOperator2 = new BinaryOperator("sdfs", 3455);
groupOperator = new GroupOperator(binaryOperator, binaryOperator2);
return binaryOperator;
}
开发者ID:aries544,项目名称:eXpand,代码行数:8,代码来源:CriteriaOperatorExtractorFixture.cs
示例10: IsFullIndexed
private bool IsFullIndexed(CriteriaOperator theOperator){
var queryOperand = theOperator as QueryOperand;
if (!ReferenceEquals(queryOperand, null)){
return IsFullIndexedCore(queryOperand.ColumnName);
}
var operandProperty = theOperator as OperandProperty;
return !ReferenceEquals(operandProperty, null) && IsFullIndexedCore(operandProperty.PropertyName);
}
开发者ID:kamchung322,项目名称:eXpand,代码行数:8,代码来源:FullTextOperatorProcessor.cs
示例11: Replace
public void Replace(ref CriteriaOperator criteriaOperator, string matchString, CriteriaOperator replaceOperator)
{
if (criteriaOperator.ToString() == matchString)
{
criteriaOperator = replaceOperator;
return;
}
Extract(criteriaOperator, matchString, replaceOperator);
}
开发者ID:aries544,项目名称:eXpand,代码行数:9,代码来源:CriteriaOperatorExtractor.cs
示例12: Remove
public void Remove(ref CriteriaOperator criteriaOperator, string removeString)
{
if (criteriaOperator.ToString() == removeString)
{
criteriaOperator = null;
return;
}
Extract(criteriaOperator, removeString);
}
开发者ID:aries544,项目名称:eXpand,代码行数:9,代码来源:CriteriaOperatorExtractor.cs
示例13: GetExpressionEvaluator
private ExpressionEvaluator GetExpressionEvaluator(CriteriaOperator criteria)
{
if (criteria.ToString() == lastCriteria)
return lastEvaluator;
lastCriteria = criteria.ToString();
PropertyDescriptorCollection pdc = ((ITypedList)_View.DataSource).GetItemProperties(null);
lastEvaluator = new ExpressionEvaluator(pdc, criteria, false);
return lastEvaluator;
}
开发者ID:JC-Developers,项目名称:SoftEmpeniosCergo,代码行数:9,代码来源:MyFindPanelFilterHelper.cs
示例14: Extract
private CriteriaOperator Extract(CriteriaOperator criteriaOperator, string matchString,
CriteriaOperator replaceOperator)
{
if (criteriaOperator is BinaryOperator)
{
var binaryOperator = (BinaryOperator) criteriaOperator;
binaryOperators.Add(binaryOperator);
return binaryOperator;
}
if (criteriaOperator is NullOperator)
{
nullOperators.Add((NullOperator) criteriaOperator);
return criteriaOperator;
}
if (criteriaOperator is NotOperator)
{
var notOperator = (NotOperator) criteriaOperator;
notOperators.Add(notOperator);
Extract(notOperator.Operand);
}
else if (criteriaOperator is UnaryOperator)
{
unaryOperators.Add((UnaryOperator) criteriaOperator);
return criteriaOperator;
}
else if (criteriaOperator is GroupOperator)
{
var groupOperator = (GroupOperator) criteriaOperator;
CriteriaOperatorCollection operands = groupOperator.Operands;
var indexesToremove = new List<int>();
for (int i = 0; i < operands.Count; i++){
CriteriaOperator operand = operands[i];
if (operand.ToString() == matchString){
if (ReferenceEquals(replaceOperator,null))
indexesToremove.Add(i);
else
operands[i] = replaceOperator;
}
else{
CriteriaOperator extract = Extract(operand);
operands.RemoveAt(i);
operands.Insert(i, extract);
}
}
foreach (int i in indexesToremove)
operands.RemoveAt(i);
}
else if (criteriaOperator is ContainsOperator)
{
var containsOperator = (ContainsOperator) criteriaOperator;
CriteriaOperator condition = containsOperator.Condition;
Extract(condition);
}
return criteriaOperator;
}
开发者ID:aries544,项目名称:eXpand,代码行数:57,代码来源:CriteriaOperatorExtractor.cs
示例15: Process
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);
}
}
开发者ID:eolandezhang,项目名称:Diagram,代码行数:9,代码来源:Evaluator.cs
示例16: CreateObject
XPBaseObject CreateObject(XElement element, UnitOfWork nestedUnitOfWork, ITypeInfo typeInfo, CriteriaOperator objectKeyCriteria){
XPBaseObject xpBaseObject = GetObject(nestedUnitOfWork, typeInfo,objectKeyCriteria) ;
var keyValuePair = new KeyValuePair<ITypeInfo, CriteriaOperator>(typeInfo, objectKeyCriteria);
if (!importedObjecs.ContainsKey(keyValuePair)) {
importedObjecs.Add(keyValuePair, null);
ImportProperties(nestedUnitOfWork, xpBaseObject, element);
}
return xpBaseObject;
}
开发者ID:gvilas,项目名称:eXpand,代码行数:9,代码来源:ImportEngine.cs
示例17: Criterion
public Criterion(string propertyName, CriteriaOperator @operator, object value,
StringMatchMode matchMode, bool caseInsensitive)
: this(propertyName, @operator, value)
{
if (@operator != CriteriaOperator.Like && @operator != CriteriaOperator.NotLike)
throw new ArgumentException();
this.matchMode = matchMode;
this.caseInsensitive = caseInsensitive;
}
开发者ID:stankela,项目名称:bilten,代码行数:9,代码来源:Criterion.cs
示例18: UnaryCriteria
public UnaryCriteria(CriteriaOperator op, BaseCriteria operand)
{
if (Object.ReferenceEquals(operand, null))
throw new ArgumentNullException("operand");
if (op < CriteriaOperator.Paren || op > CriteriaOperator.Exists)
throw new ArgumentOutOfRangeException("op");
this.op = op;
this.operand = operand;
}
开发者ID:votrongdao,项目名称:Serenity,代码行数:11,代码来源:UnaryCriteria.cs
示例19: createObject
XPBaseObject createObject(XElement element, UnitOfWork nestedUnitOfWork, ITypeInfo typeInfo, CriteriaOperator objectKeyCriteria)
{
XPBaseObject xpBaseObject = findObject(nestedUnitOfWork, typeInfo,objectKeyCriteria) ??
(XPBaseObject) Activator.CreateInstance(typeInfo.Type, nestedUnitOfWork);
if (!importingObjecs.Contains(xpBaseObject)) {
importingObjecs.Add(xpBaseObject);
importProperties(nestedUnitOfWork, xpBaseObject, element);
importingObjecs.Remove(xpBaseObject);
}
return xpBaseObject;
}
开发者ID:corzar,项目名称:eXpand,代码行数:11,代码来源:ImportEngine.cs
示例20: FilterEvaluator
public FilterEvaluator(EvaluatorContextDescriptor descriptor, CriteriaOperator filterCriteria)
{
this.evaluatorCore = new ExpressionEvaluatorCore(true);
this.descriptor = descriptor;
this.filterCriteria = filterCriteria;
this.contexts = typeof (ExpressionEvaluatorCore).GetField("contexts", BindingFlags.Instance | BindingFlags.NonPublic);
FieldInfo fieldInfo = typeof(ExpressionEvaluatorCore).GetField("LikeDataCache", BindingFlags.Instance | BindingFlags.NonPublic);
likeDataCache = (LikeDataCache) fieldInfo.GetValue(this.evaluatorCore);
}
开发者ID:Gremlin2,项目名称:bookscanner,代码行数:11,代码来源:FilterEvaluator.cs
注:本文中的CriteriaOperator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论