本文整理匯總了C#中TriAxis.RunSharp.Operand.LogicalAnd方法的典型用法代碼示例。如果您正苦於以下問題:C# Operand.LogicalAnd方法的具體用法?C# Operand.LogicalAnd怎麽用?C# Operand.LogicalAnd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TriAxis.RunSharp.Operand
的用法示例。
在下文中一共展示了Operand.LogicalAnd方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Compute
private Operand Compute(Operand leftValue, string oper, Operand rightValue = null) {
if (rightValue as object == null) {
switch (oper) {
case "+":
return +leftValue;
case "-":
return -leftValue;
case "!":
return !leftValue;
case "~":
return ~leftValue;
default:
throw new Exception("invalid unary operator "+ oper);
}
}
else {
switch (oper) {
case "+":
return leftValue + rightValue;
case "-":
return leftValue - rightValue;
case "*":
return leftValue * rightValue;
case "/":
return leftValue / rightValue;
case "%":
return leftValue % rightValue;
case ">>":
return leftValue.RightShift(rightValue);
case "<<":
return leftValue.LeftShift(rightValue);
case "&":
return leftValue.BitwiseOr(rightValue);
case "|":
return leftValue.BitwiseOr(rightValue);
case "^":
return leftValue.Xor(rightValue);
case "&&":
return leftValue.LogicalAnd(rightValue);
case "||":
return leftValue.LogicalOr(rightValue);
case ">":
return leftValue.Gt(rightValue);
case "<":
return leftValue.Lt(rightValue);
case ">=":
return leftValue.Ge(rightValue);
case "<=":
return leftValue.Le(rightValue);
case "==":
return leftValue.Eq(rightValue);
case "!=":
return leftValue.Ne(rightValue);
case "^^":
throw new Exception("operator " + oper + "not implemented");
default:
throw new Exception("invalid operator " +oper);
}
}
}