当前位置: 首页>>代码示例>>C#>>正文


C# BinaryOperatorKind.ToString方法代码示例

本文整理汇总了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());
     }
 }
开发者ID:tgjones,项目名称:HlslTools,代码行数:44,代码来源:BinaryOperator.cs

示例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());
     }
 }
开发者ID:nemec,项目名称:roslyn,代码行数:18,代码来源:AbstractMethodXmlBuilder.cs

示例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;
        }
开发者ID:larsenjo,项目名称:odata.net,代码行数:16,代码来源:BinaryOperatorBinder.cs


注:本文中的BinaryOperatorKind.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。