當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。