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


C# BinaryOperatorType.ToString方法代码示例

本文整理汇总了C#中BinaryOperatorType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryOperatorType.ToString方法的具体用法?C# BinaryOperatorType.ToString怎么用?C# BinaryOperatorType.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BinaryOperatorType的用法示例。


在下文中一共展示了BinaryOperatorType.ToString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetBinaryOperatorText


//.........这里部分代码省略.........
                    return "/";
                }

                case BinaryOperatorType.GreaterThan:
                {
                    return ">";
                }

                case BinaryOperatorType.GreaterThanOrEqual:
                {
                    return ">=";
                }

                case BinaryOperatorType.LessThan:
                {
                    return "<";
                }

                case BinaryOperatorType.LessThanOrEqual:
                {
                    return "<=";
                }

                case BinaryOperatorType.Modulus:
                {
                    return "%";
                }

                case BinaryOperatorType.Member:
                {
                    return "in";
                }

                case BinaryOperatorType.NotMember:
                {
                    return "not in";
                }

                case BinaryOperatorType.ReferenceEquality:
                {
                    return "is";
                }

                case BinaryOperatorType.ReferenceInequality:
                {
                    return "is not";
                }

                case BinaryOperatorType.TypeTest:
                {
                    return "isa";
                }

                case BinaryOperatorType.Or:
                {
                    return "or";
                }

                case BinaryOperatorType.And:
                {
                    return "and";
                }

                case BinaryOperatorType.BitwiseOr:
                {
                    return "|";
                }

                case BinaryOperatorType.BitwiseAnd:
                {
                    return "&";
                }

                case BinaryOperatorType.ExclusiveOr:
                {
                    return "^";
                }

                case BinaryOperatorType.ShiftLeft:
                {
                    return "<<";
                }

                case BinaryOperatorType.ShiftRight:
                {
                    return ">>";
                }

                case BinaryOperatorType.InPlaceShiftLeft:
                {
                    return "<<=";
                }

                case BinaryOperatorType.InPlaceShiftRight:
                {
                    return ">>=";
                }
            }
            throw new NotImplementedException(op.ToString());
        }
开发者ID:w4x,项目名称:boolangstudio,代码行数:101,代码来源:BooPrinterVisitor.cs

示例2: GetBinaryNumericPromotionCode

 internal static TypeCode GetBinaryNumericPromotionCode(Type left, Type right, BinaryOperatorType exceptionType, bool raiseException)
 {
     TypeCode leftTC = Type.GetTypeCode(left);
     TypeCode rightTC = Type.GetTypeCode(right);
     Dictionary<TypeCode, TypeCode> rights;
     if(!BinaryNumericPromotions.TryGetValue(leftTC, out rights)) {
         if(raiseException)
             throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, FilteringExceptionsText.ExpressionEvaluatorOperatorSubtypeNotSupportedForSpecificOperandType, typeof(BinaryOperator).Name, exceptionType.ToString(), left.FullName));
         else return TypeCode.Object;
     }
     TypeCode result;
     if(!rights.TryGetValue(rightTC, out result)) {
         if(raiseException)
             throw new NotSupportedException(string.Format(CultureInfo.InvariantCulture, FilteringExceptionsText.ExpressionEvaluatorOperatorSubtypeNotSupportedForSpecificOperandType, typeof(BinaryOperator).Name, exceptionType.ToString(), right.FullName));
         else return TypeCode.Object;
     }
     return result;
 }
开发者ID:eolandezhang,项目名称:Diagram,代码行数:18,代码来源:Evaluator.cs

示例3: GetMethodNameForOperator

 public static string GetMethodNameForOperator(BinaryOperatorType op)
 {
     return "op_" + op.ToString();
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:4,代码来源:AstUtil.cs


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