本文整理汇总了C#中BinaryOperatorKind.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryOperatorKind.ToString方法的具体用法?C# BinaryOperatorKind.ToString怎么用?C# BinaryOperatorKind.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryOperatorKind
的用法示例。
在下文中一共展示了BinaryOperatorKind.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBuiltInSignatures
private static IEnumerable<BinaryOperatorSignature> GetBuiltInSignatures(BinaryOperatorKind kind)
{
switch (kind)
{
case BinaryOperatorKind.Multiply:
return BuiltInMultiplySignatures;
case BinaryOperatorKind.Divide:
return BuiltInDivideSignatures;
case BinaryOperatorKind.Modulo:
return BuiltInModulusSignatures;
case BinaryOperatorKind.Add:
return BuiltInAddSignatures;
case BinaryOperatorKind.Subtract:
return BuiltInSubSignatures;
case BinaryOperatorKind.Equal:
return BuiltInEqualSignatures;
case BinaryOperatorKind.NotEqual:
return BuiltInNotEqualSignatures;
case BinaryOperatorKind.Less:
return BuiltInLessSignatures;
case BinaryOperatorKind.LessEqual:
return BuiltInLessOrEqualSignatures;
case BinaryOperatorKind.Greater:
return BuiltInGreaterSignatures;
case BinaryOperatorKind.GreaterEqual:
return BuiltInGreaterOrEqualSignatures;
case BinaryOperatorKind.BitwiseXor:
return BuiltInBitXorSignatures;
case BinaryOperatorKind.BitwiseAnd:
return BuiltInBitAndSignatures;
case BinaryOperatorKind.BitwiseOr:
return BuiltInBitOrSignatures;
case BinaryOperatorKind.LeftShift:
return BuiltInLeftShiftSignatures;
case BinaryOperatorKind.RightShift:
return BuiltInRightShiftSignatures;
case BinaryOperatorKind.LogicalAnd:
return BuiltInLogicalAndSignatures;
case BinaryOperatorKind.LogicalOr:
return BuiltInLogicalOrSignatures;
default:
throw new ArgumentOutOfRangeException(nameof(kind), kind.ToString());
}
}
示例2: GetBinaryOperatorKindText
private static string GetBinaryOperatorKindText(BinaryOperatorKind kind)
{
switch (kind)
{
case BinaryOperatorKind.Plus:
return "plus";
case BinaryOperatorKind.BitwiseOr:
return "bitor";
case BinaryOperatorKind.BitwiseAnd:
return "bitand";
case BinaryOperatorKind.Concatenate:
return "concatenate";
case BinaryOperatorKind.AddDelegate:
return "adddelegate";
default:
throw new InvalidOperationException("Invalid BinaryOperatorKind: " + kind.ToString());
}
}
示例3: GetOperandFromToken
/// <summary>
/// Retrieve SingleValueNode bound with given query token.
/// </summary>
/// <param name="operatorKind">the query token kind</param>
/// <param name="queryToken">the query token</param>
/// <returns>the corresponding SingleValueNode</returns>
private SingleValueNode GetOperandFromToken(BinaryOperatorKind operatorKind, QueryToken queryToken)
{
SingleValueNode operand = this.bindMethod(queryToken) as SingleValueNode;
if (operand == null)
{
throw new ODataException(ODataErrorStrings.MetadataBinder_BinaryOperatorOperandNotSingleValue(operatorKind.ToString()));
}
return operand;
}