本文整理汇总了C#中IOperand类的典型用法代码示例。如果您正苦于以下问题:C# IOperand类的具体用法?C# IOperand怎么用?C# IOperand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IOperand类属于命名空间,在下文中一共展示了IOperand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Bucket
private Bucket(IOperand operand)
{
if (operand == null)
throw new ArgumentNullException("operand");
_operand = operand;
}
示例2: BinaryOperationBase
protected BinaryOperationBase(IOperationResultBuilder operationResultBuilder,
IOperand fieldRefOperand, IOperand valueOperand)
: base(operationResultBuilder)
{
this.fieldRefOperand = fieldRefOperand;
this.valueOperand = valueOperand;
}
示例3: BinaryOperationBase
protected BinaryOperationBase(IOperationResultBuilder operationResultBuilder,
IOperand columnOperand, IOperand valueOperand)
: base(operationResultBuilder)
{
this.ColumnOperand = columnOperand;
this.ValueOperand = valueOperand;
}
示例4: ReplaceLastOperand
public void ReplaceLastOperand(IOperand operand)
{
if (Operands.Count == 0)
{
throw new InvalidOperationException("There are no operands to replace.");
}
int stealIndex = Operands.Count - 1;
NativeOperation op = Operands[stealIndex] as NativeOperation;
// Check if the "steal" target is itself something that we can steal from, if so,
// recurse. This rule of checkiung association type is a bit confusing, this should
// be a property?
if (op !=null && op.Operands.Count > 1 && op.AssociationType == AssociationType.Multiplicaton)
{
IOperation func = (IOperation)op;
func.ReplaceLastOperand(operand);
}
else
{
_Operands[Operands.Count - 1] = operand;
}
}
示例5: GreaterThan
public IOperand GreaterThan(IOperand rhs)
{
if (!(rhs is LongOperand))
throw new RPN_Exception("Argument invalid in LongOperand.> : rhs");
BoolOperand oprResult = new BoolOperand("Result");
oprResult.Value = ((long)this.Value > (long)((Operand)rhs).Value) ? true : false;
return oprResult;
}
示例6: EqualTo
/// IComparisonOperators methods. Return values are always BooleanOperands type
public IOperand EqualTo(IOperand rhs)
{
if (!(rhs is LongOperand))
throw new RPN_Exception("Argument invalid in LongOperand.== : rhs");
BoolOperand oprResult = new BoolOperand("Result");
oprResult.Value = (long)this.Value == (long)((Operand)rhs).Value;
return oprResult;
}
示例7: Divide
public IOperand Divide(IOperand rhs)
{
if (!(rhs is LongOperand))
throw new RPN_Exception("Argument invalid in LongOperand.Divide : rhs");
LongOperand oprResult = new LongOperand("Result", Type.GetType("System.Int64"));
oprResult.Value = (long)this.Value / (long)((Operand)rhs).Value;
return oprResult;
}
示例8: LessThanOrEqualTo
public IOperand LessThanOrEqualTo(IOperand rhs)
{
if (!(rhs is LongOperand))
throw new RPN_Exception("Argument invalid in LongOperand.<= : rhs");
BoolOperand oprResult = new BoolOperand("Result");
oprResult.Value = ((long)this.Value <= (long)((Operand)rhs).Value) ? true : false;
return oprResult;
}
示例9: OR
public IOperand OR(IOperand rhs)
{
if (!(rhs is BoolOperand))
throw new RPN_Exception("Argument invalid in BoolOperand.|| : rhs");
BoolOperand oprResult = new BoolOperand("Result");
oprResult.Value = ((bool)this.Value || (bool)((Operand)rhs).Value) ? true : false;
return oprResult;
}
示例10: Match
internal static bool Match(PackageItem package, IOperand operand)
{
var expression = operand as Expression;
if (expression != null)
return MatchExpression(package, expression);
return MatchPredicate(package, operand);
}
示例11: ReplaceLastOperand
public void ReplaceLastOperand(IOperand operand)
{
if (Operands.Count == 0)
{
throw new InvalidOperationException("There are no operands to replace.");
}
_Operands[Operands.Count - 1] = operand;
}
示例12: CopyTo
protected override IOperand CopyTo(IOperand operand)
{
NativeOperation target = (NativeOperation)operand;
foreach (var item in _Operators)
{
target._Operators.Add(item);
}
return base.CopyTo(target);
}
示例13: DateRangesOverlapOperation
public DateRangesOverlapOperation(IOperationResultBuilder operationResultBuilder,
IOperand startFieldRefOperand, IOperand stopFieldRefOperand, IOperand recurrenceFieldRefOperand, IOperand dateTimeOperand)
: base(operationResultBuilder)
{
this.startFieldRefOperand = startFieldRefOperand;
this.stopFieldRefOperand = stopFieldRefOperand;
this.recurrenceFieldRefOperand = recurrenceFieldRefOperand;
this.dateTimeOperand = dateTimeOperand;
}
示例14: MatchPredicate
private static bool MatchPredicate(PackageItem package, IOperand predicate)
{
var unaryPredicate = predicate as UnaryPredicate;
if (unaryPredicate != null)
return MatchPredicate(package, unaryPredicate);
var binaryPredicate = predicate as BinaryPredicate;
if (binaryPredicate != null)
return MatchPredicate(package, binaryPredicate);
return true;
}
示例15: Range
private Range(IOperand min = null, IOperand max = null, bool minInclusive = false, bool maxInclusive = false)
{
if (min == null && max == null)
throw new ArgumentException("Min and max cannot both be null.");
// TODO check min < max?
Min = min;
Max = max;
MinInclusive = minInclusive;
MaxInclusive = maxInclusive;
}