本文整理汇总了C#中ComparisonOperator类的典型用法代码示例。如果您正苦于以下问题:C# ComparisonOperator类的具体用法?C# ComparisonOperator怎么用?C# ComparisonOperator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComparisonOperator类属于命名空间,在下文中一共展示了ComparisonOperator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueryStrings
// Constructors
public QueryStrings(int fieldId, ComparisonOperator comparisonOp, string matchingValue, LogicalOperator logicalOp)
{
FieldId = fieldId;
ComparisonOp = comparisonOp;
MatchingValue = matchingValue;
LogicalOp = logicalOp;
}
示例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;
}
}
示例3: DateDiffCompareValidator
public DateDiffCompareValidator(ValueAccess valueAccess, ComparisonOperator comparisonOperator, int dateDiff)
: base(valueAccess, comparisonOperator)
{
this.valueAccess = valueAccess;
this.comparisonOperator = comparisonOperator;
this.dateDiff = dateDiff;
}
示例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 "";
}
}
示例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");
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例10: PropertyComparisonValidatorAttribute
public PropertyComparisonValidatorAttribute(string propertyToCompare, ComparisonOperator comparisonOperator)
{
if (propertyToCompare == null)
{
throw new ArgumentNullException("propertyToCompare");
}
this.propertyToCompare = propertyToCompare;
this.comparisonOperator = comparisonOperator;
}
示例11: NodeComparison
public NodeComparison(Int64 size, ComparisonOperator comparison = null)
{
this.Size = size;
if (comparison == null)
this.Operator = ComparisonOperator.Equals;
else
this.Operator = comparison;
}
示例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;
}
示例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();
}
示例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;
}
示例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);
}