本文整理汇总了C#中ComparisonOperator类的典型用法代码示例。如果您正苦于以下问题:C# ComparisonOperator类的具体用法?C# ComparisonOperator怎么用?C# ComparisonOperator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComparisonOperator类属于命名空间,在下文中一共展示了ComparisonOperator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: QueryStrings
// Constructors
public QueryStrings(int fieldId, ComparisonOperator comparisonOp, string matchingValue, LogicalOperator logicalOp)
{
FieldId = fieldId;
ComparisonOp = comparisonOp;
MatchingValue = matchingValue;
LogicalOp = logicalOp;
}
开发者ID:jherig,项目名称:QuickBase-C-Sharp-SDK,代码行数:8,代码来源:QueryStrings.cs
示例2: CompareExpression
public CompareExpression(ComparisonOperator operation, IExpression left, IExpression right)
: base(left, right)
{
this.operation = operation;
switch (operation)
{
case ComparisonOperator.Equal:
this.function = Operators.CompareObjectEqual;
break;
case ComparisonOperator.NotEqual:
this.function = Operators.CompareObjectNotEqual;
break;
case ComparisonOperator.Less:
this.function = Operators.CompareObjectLess;
break;
case ComparisonOperator.LessEqual:
this.function = Operators.CompareObjectLessEqual;
break;
case ComparisonOperator.Greater:
this.function = Operators.CompareObjectGreater;
break;
case ComparisonOperator.GreaterEqual:
this.function = Operators.CompareObjectGreaterEqual;
break;
}
}
开发者ID:Refandler,项目名称:PythonSharp,代码行数:27,代码来源:CompareExpression.cs
示例3: DateDiffCompareValidator
public DateDiffCompareValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator, int dateDiff)
: base(valueAccess, comparisonOperator)
{
this.valueAccess = valueAccess;
this.comparisonOperator = comparisonOperator;
this.dateDiff = dateDiff;
}
开发者ID:rentianhua,项目名称:AgileMVC,代码行数:7,代码来源:DateDiffCompareValidator.cs
示例4: Parse
public static string Parse(ComparisonOperator comparisonOperator, string param)
{
switch (comparisonOperator)
{
case ComparisonOperator.Contains:
return string.Format("Like '%{0}%'", HttpUtility.UrlEncode(SoqlUtil.Escape(param)));
case ComparisonOperator.Equals:
return string.Format("='{0}'", HttpUtility.UrlEncode(SoqlUtil.Escape(param)));
case ComparisonOperator.GreaterOrEqual:
return string.Format(">='{0}'", HttpUtility.UrlEncode(SoqlUtil.Escape(param)));
case ComparisonOperator.GreaterThan:
return string.Format(">'{0}'", HttpUtility.UrlEncode(SoqlUtil.Escape(param)));
case ComparisonOperator.In:
return string.Format(" IN ({0})", HttpUtility.UrlEncode(SoqlUtil.Escape(param)));
case ComparisonOperator.LessOrEqual:
return string.Format("<='{0}'", HttpUtility.UrlEncode(SoqlUtil.Escape(param)));
case ComparisonOperator.LessThan:
return string.Format("<'{0}'", HttpUtility.UrlEncode(SoqlUtil.Escape(param)));
case ComparisonOperator.NotEquals:
return string.Format("!='{0}'", HttpUtility.UrlEncode(SoqlUtil.Escape(param)));
case ComparisonOperator.NotIn:
return string.Format("NOT IN ({0})", HttpUtility.UrlEncode(SoqlUtil.Escape(param)));
case ComparisonOperator.StartsWith:
return string.Format("Like '{0}%'", HttpUtility.UrlEncode(SoqlUtil.Escape(param)));
default:
return "";
}
}
开发者ID:clone278,项目名称:sitecore-salesforce-connect,代码行数:28,代码来源:ComparisonOperatorParser.cs
示例5: CompareExpression
public CompareExpression(ComparisonOperator operation, IExpression left, IExpression right)
: base(left, right)
{
this.operation = operation;
switch (operation)
{
case ComparisonOperator.NonStrictEqual:
this.function = NonStrictEqual;
break;
case ComparisonOperator.NonStrictNotEqual:
this.function = NonStrictNotEqual;
break;
case ComparisonOperator.Equal:
this.function = Operators.CompareObjectEqual;
break;
case ComparisonOperator.NotEqual:
this.function = Operators.CompareObjectNotEqual;
break;
case ComparisonOperator.Less:
this.function = Operators.CompareObjectLess;
break;
case ComparisonOperator.LessEqual:
this.function = Operators.CompareObjectLessEqual;
break;
case ComparisonOperator.Greater:
this.function = Operators.CompareObjectGreater;
break;
case ComparisonOperator.GreaterEqual:
this.function = Operators.CompareObjectGreaterEqual;
break;
default:
throw new ArgumentException("Invalid operator");
}
}
开发者ID:ajlopez,项目名称:AjScript,代码行数:35,代码来源:CompareExpression.cs
示例6: CreateConditionalFormattingRule
/**
* A factory method allowing to create a conditional formatting rule
* with a cell comparison operator<p/>
* TODO - formulas Containing cell references are currently not Parsed properly
*
* @param comparisonOperation - a constant value from
* <tt>{@link NPOI.hssf.record.CFRuleRecord.ComparisonOperator}</tt>: <p>
* <ul>
* <li>BETWEEN</li>
* <li>NOT_BETWEEN</li>
* <li>EQUAL</li>
* <li>NOT_EQUAL</li>
* <li>GT</li>
* <li>LT</li>
* <li>GE</li>
* <li>LE</li>
* </ul>
* </p>
* @param formula1 - formula for the valued, Compared with the cell
* @param formula2 - second formula (only used with
* {@link NPOI.ss.usermodel.ComparisonOperator#BETWEEN}) and
* {@link NPOI.ss.usermodel.ComparisonOperator#NOT_BETWEEN} operations)
*/
public IConditionalFormattingRule CreateConditionalFormattingRule(
ComparisonOperator comparisonOperation,
String formula1,
String formula2)
{
XSSFConditionalFormattingRule rule = new XSSFConditionalFormattingRule(_sheet);
CT_CfRule cfRule = rule.GetCTCfRule();
cfRule.AddFormula(formula1);
if (formula2 != null) cfRule.AddFormula(formula2);
cfRule.type = (ST_CfType.cellIs);
ST_ConditionalFormattingOperator operator1;
switch (comparisonOperation)
{
case ComparisonOperator.BETWEEN: operator1 = ST_ConditionalFormattingOperator.between; break;
case ComparisonOperator.NOT_BETWEEN: operator1 = ST_ConditionalFormattingOperator.notBetween; break;
case ComparisonOperator.LT: operator1 = ST_ConditionalFormattingOperator.lessThan; break;
case ComparisonOperator.LE: operator1 = ST_ConditionalFormattingOperator.lessThanOrEqual; break;
case ComparisonOperator.GT: operator1 = ST_ConditionalFormattingOperator.greaterThan; break;
case ComparisonOperator.GE: operator1 = ST_ConditionalFormattingOperator.greaterThanOrEqual; break;
case ComparisonOperator.EQUAL: operator1 = ST_ConditionalFormattingOperator.equal; break;
case ComparisonOperator.NOT_EQUAL: operator1 = ST_ConditionalFormattingOperator.notEqual; break;
default: throw new ArgumentException("Unknown comparison operator: " + comparisonOperation);
}
[email protected] = (operator1);
return rule;
}
开发者ID:xoposhiy,项目名称:npoi,代码行数:51,代码来源:XSSFSheetConditionalFormatting.cs
示例7: InterPropRule
///<summary>
///</summary>
///<param name="propLeft"></param>
///<param name="comparisonOperator"></param>
///<param name="propRight"></param>
///<exception cref="ArgumentNullException"></exception>
public InterPropRule(IPropDef propLeft, ComparisonOperator comparisonOperator, IPropDef propRight)
{
if (propLeft == null) throw new ArgumentNullException("propLeft");
if (propRight == null) throw new ArgumentNullException("propRight");
LeftProp = propLeft;
ComparisonOp = comparisonOperator;
RightProp = propRight;
}
开发者ID:kevinbosman,项目名称:habanero,代码行数:14,代码来源:InterPropRule.cs
示例8: FilterOperation
public FilterOperation(string inKey, string outKey, string outType, object value, ComparisonOperator comparisonOperator)
: base(inKey, outKey) {
_value = Common.GetObjectConversionMap()[outType](value);
_comparisonOperator = comparisonOperator;
Name = string.Format("FilterOperation ({0})", outKey);
IsFilter = true;
}
开发者ID:modulexcite,项目名称:Transformalize,代码行数:8,代码来源:FilterOperation.cs
示例9: CreateConditionalFormattingRule
public IConditionalFormattingRule CreateConditionalFormattingRule(
ComparisonOperator comparisonOperation,
String formula1)
{
HSSFWorkbook wb = (HSSFWorkbook)_sheet.Workbook;
CFRuleRecord rr = CFRuleRecord.Create(_sheet, (byte)comparisonOperation, formula1, null);
return new HSSFConditionalFormattingRule(wb, rr);
}
开发者ID:JnS-Software-LLC,项目名称:npoi,代码行数:8,代码来源:HSSFSheetConditionalFormatting.cs
示例10: PropertyComparisonValidatorAttribute
public PropertyComparisonValidatorAttribute(string propertyToCompare, ComparisonOperator comparisonOperator)
{
if (propertyToCompare == null)
{
throw new ArgumentNullException("propertyToCompare");
}
this.propertyToCompare = propertyToCompare;
this.comparisonOperator = comparisonOperator;
}
开发者ID:davinx,项目名称:himedi,代码行数:9,代码来源:PropertyComparisonValidatorAttribute.cs
示例11: NodeComparison
public NodeComparison(Int64 size, ComparisonOperator comparison = null)
{
this.Size = size;
if (comparison == null)
this.Operator = ComparisonOperator.Equals;
else
this.Operator = comparison;
}
开发者ID:kbolay,项目名称:Bolay.Elastic,代码行数:9,代码来源:NodeComparison.cs
示例12: ValueAccessComparisonValidator
/// <summary>
/// Initializes a new instance of the <see cref="ValueAccessComparisonValidator"/> class.
/// </summary>
/// <param name="valueAccess">The <see cref="ValueAccess"/> to use when extracting the comparison operand.</param>
/// <param name="comparisonOperator">The <see cref="ComparisonOperator"/> that specifies the kind of
/// comparison to perform.</param>
/// <param name="messageTemplate">The message template to use when logging validation failures.</param>
/// <param name="tag">The tag that describes the purpose of the validator.</param>
public ValueAccessComparisonValidator(ValueAccess valueAccess,
ComparisonOperator comparisonOperator,
string messageTemplate,
string tag)
: this(valueAccess, comparisonOperator, messageTemplate, tag, false)
{
this.valueAccess = valueAccess;
this.comparisonOperator = comparisonOperator;
}
开发者ID:HondaBey,项目名称:EnterpriseLibrary6,代码行数:17,代码来源:ValueAccessComparisonValidator.cs
示例13: NumericComparisonColumnAutoFillUserSettings
//*************************************************************************
// Constructor: NumericComparisonColumnAutoFillUserSettings()
//
/// <summary>
/// Initializes a new instance of the
/// NumericComparisonColumnAutoFillUserSettings class.
/// </summary>
//*************************************************************************
public NumericComparisonColumnAutoFillUserSettings()
{
m_eComparisonOperator = ComparisonOperator.GreaterThan;
m_dSourceNumberToCompareTo = 0;
m_sDestinationString1 = null;
m_sDestinationString2 = null;
AssertValid();
}
开发者ID:haisreekanth,项目名称:NetMap,代码行数:17,代码来源:NumericComparisonColumnAutoFillUserSettings.cs
示例14: ValueAccessComparisonValidator
public ValueAccessComparisonValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator, string messageTemplate, string tag, bool negated)
: base(messageTemplate, tag, negated)
{
if (valueAccess == null)
{
throw new ArgumentNullException("valueAccess");
}
this.valueAccess = valueAccess;
this.comparisonOperator = comparisonOperator;
}
开发者ID:davinx,项目名称:himedi,代码行数:10,代码来源:ValueAccessComparisonValidator.cs
示例15: CreateConditionalFormattingRule
/// <summary>
/// A factory method allowing to Create a conditional formatting rule
/// with a cell comparison operator
/// TODO - formulas containing cell references are currently not Parsed properly
/// </summary>
/// <param name="comparisonOperation">a constant value from HSSFConditionalFormattingRule.ComparisonOperator</param>
/// <param name="formula1">formula for the valued, Compared with the cell</param>
/// <param name="formula2">second formula (only used with HSSFConditionalFormattingRule#COMPARISON_OPERATOR_BETWEEN
/// and HSSFConditionalFormattingRule#COMPARISON_OPERATOR_NOT_BETWEEN operations)</param>
/// <returns></returns>
public HSSFConditionalFormattingRule CreateConditionalFormattingRule(
ComparisonOperator comparisonOperation,
String formula1,
String formula2)
{
HSSFWorkbook wb = _workbook;
CFRuleRecord rr = CFRuleRecord.Create(wb, comparisonOperation, formula1, formula2);
return new HSSFConditionalFormattingRule(wb, rr);
}
开发者ID:ChiangHanLung,项目名称:PIC_VDS,代码行数:20,代码来源:HSSFSheetConditionalFormatting.cs
示例16: Clause
public Clause(string ColumnName, ComparisonOperator Operator, object Value)
{
Contract.Requires(ColumnName != null);
this.ColumnName = ColumnName;
this.Operator = Operator;
this.Value = Value;
this.CaseSensitive = true;
this.Level = 1;
}
开发者ID:Aestek,项目名称:IrisMailer,代码行数:10,代码来源:Clause.cs
示例17: Serialize_ComparisionFilter
public void Serialize_ComparisionFilter(ComparisonOperator op, string expectedJson)
{
var filters = new SearchFilterCollection
{
new ComparisonFilter(x => x.NutritionFact_Calories){Operator = op, Value = 100}
};
string json = JsonConvert.SerializeObject(filters);
StringAssert.Contains(expectedJson, json);
}
开发者ID:carolynvs,项目名称:nutritionix,代码行数:10,代码来源:SearchFilterCollectionFixture.cs
示例18: Where
public wDBRowCollection Where(string what, ComparisonOperator op, object operand)
{
string operandTwo = "";
if (operand is int)
operandTwo = ((int)operand).ToString();
else if (operand is string)
operandTwo = (string)operand;
else if (operand is bool)
operandTwo = ((bool)operand) ? "1" : "0";
wDBRowCollection newCollection = new wDBRowCollection();
for (int i = 0; i < this.rows.Count; i++)
{
string operandOne = this.rows[i][what];
double opOne = 0, opTwo = 0;
double.TryParse(operandOne, out opOne);
double.TryParse(operandTwo, out opTwo);
switch(op)
{
case ComparisonOperator.Is:
if(operandOne == operandTwo)
newCollection.rows.Add(this.rows[i]);
break;
case ComparisonOperator.IsNot:
if(operandOne != operandTwo)
newCollection.rows.Add(this.rows[i]);
break;
case ComparisonOperator.LessThan:
if(opOne < opTwo)
newCollection.rows.Add(this.rows[i]);
break;
case ComparisonOperator.LessThanEqualTo:
if(opOne <= opTwo)
newCollection.rows.Add(this.rows[i]);
break;
case ComparisonOperator.GreaterThan:
if(opOne > opTwo)
newCollection.rows.Add(this.rows[i]);
break;
case ComparisonOperator.GreaterThanEqualTo:
if(opOne >= opTwo)
newCollection.rows.Add(this.rows[i]);
break;
case ComparisonOperator.StartsWith:
{
if (operandOne.StartsWith(operandTwo))
{
newCollection.rows.Add(this.rows[i]);
}
break;
}
}
}
return newCollection;
}
开发者ID:ItzWarty,项目名称:commons,代码行数:55,代码来源:wDBRowCollection.cs
示例19: ById
public static IQueryable<Tracker.Core.Data.Guid> ById(this IQueryable<Tracker.Core.Data.Guid> queryable, ComparisonOperator comparisonOperator, System.Guid id)
{
switch (comparisonOperator)
{
case ComparisonOperator.GreaterThan:
case ComparisonOperator.GreaterThanOrEquals:
case ComparisonOperator.LessThan:
case ComparisonOperator.LessThanOrEquals:
throw new ArgumentException("Parameter 'comparisonOperator' must be ComparisonOperator.Equals or ComparisonOperator.NotEquals to support System.Guid type.", "comparisonOperator");
case ComparisonOperator.NotEquals:
return queryable.Where(g => g.Id != id);
default:
return queryable.Where(g => g.Id == id);
}
}
开发者ID:codesmithtools,项目名称:Framework-Samples,代码行数:15,代码来源:GuidExtensions.Generated.cs
示例20: ByOrderId
public static IQueryable<PetShop.Core.Data.Order> ByOrderId(this IQueryable<PetShop.Core.Data.Order> queryable, ComparisonOperator comparisonOperator, int orderId)
{
switch (comparisonOperator)
{
case ComparisonOperator.GreaterThan:
return queryable.Where(o => o.OrderId > orderId);
case ComparisonOperator.GreaterThanOrEquals:
return queryable.Where(o => o.OrderId >= orderId);
case ComparisonOperator.LessThan:
return queryable.Where(o => o.OrderId < orderId);
case ComparisonOperator.LessThanOrEquals:
return queryable.Where(o => o.OrderId <= orderId);
case ComparisonOperator.NotEquals:
return queryable.Where(o => o.OrderId != orderId);
default:
return queryable.Where(o => o.OrderId == orderId);
}
}
开发者ID:codesmithtools,项目名称:Framework-Samples,代码行数:18,代码来源:OrderExtensions.Generated.cs
注:本文中的ComparisonOperator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论