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


C# ICSharpCode.NRefactory.CSharp.ToString方法代码示例

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


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

示例1: GetUnaryOperator

        private ExpressionType GetUnaryOperator(NRefactory.UnaryOperatorType @operator) {
            ExpressionType type;

            if (!Enum.TryParse<ExpressionType>(@operator.ToString(), true, out type)) {
                switch (@operator) {
                    case ICSharpCode.NRefactory.CSharp.UnaryOperatorType.BitNot:

                        return ExpressionType.Not;

                    case ICSharpCode.NRefactory.CSharp.UnaryOperatorType.Decrement:

                        return ExpressionType.Decrement;

                    case ICSharpCode.NRefactory.CSharp.UnaryOperatorType.Increment:

                        return ExpressionType.Increment;

                    case ICSharpCode.NRefactory.CSharp.UnaryOperatorType.Minus:

                        return ExpressionType.Negate;

                    case ICSharpCode.NRefactory.CSharp.UnaryOperatorType.Not:

                        return ExpressionType.NotEqual;

                    case ICSharpCode.NRefactory.CSharp.UnaryOperatorType.Plus:

                        return ExpressionType.Add;

                    case ICSharpCode.NRefactory.CSharp.UnaryOperatorType.PostDecrement:

                        return ExpressionType.PostDecrementAssign;

                    case ICSharpCode.NRefactory.CSharp.UnaryOperatorType.PostIncrement:

                        return ExpressionType.PostIncrementAssign;

                    default:

                        throw new NotSupportedException();
                }
            }

            return type;
        }
开发者ID:sagifogel,项目名称:NJection.LambdaConverter,代码行数:45,代码来源:Unary.cs

示例2: GetBinaryOperator

        private ExpressionType GetBinaryOperator(NRefactory.BinaryOperatorType @operator) {
            ExpressionType type;

            if (!Enum.TryParse<ExpressionType>(@operator.ToString(), true, out type)) {
                switch (@operator) {
                    case ICSharpCode.NRefactory.CSharp.BinaryOperatorType.Any:

                        return ExpressionType.Add;

                    case ICSharpCode.NRefactory.CSharp.BinaryOperatorType.BitwiseAnd:

                        return ExpressionType.And;

                    case ICSharpCode.NRefactory.CSharp.BinaryOperatorType.BitwiseOr:

                        return ExpressionType.Or;

                    case ICSharpCode.NRefactory.CSharp.BinaryOperatorType.ConditionalAnd:

                        return ExpressionType.AndAlso;

                    case ICSharpCode.NRefactory.CSharp.BinaryOperatorType.ConditionalOr:

                        return ExpressionType.OrElse;

                    case ICSharpCode.NRefactory.CSharp.BinaryOperatorType.Divide:

                        return ExpressionType.Divide;

                    case ICSharpCode.NRefactory.CSharp.BinaryOperatorType.Equality:

                        return ExpressionType.Equal;

                    case ICSharpCode.NRefactory.CSharp.BinaryOperatorType.InEquality:

                        return ExpressionType.NotEqual;

                    case ICSharpCode.NRefactory.CSharp.BinaryOperatorType.Modulus:

                        return ExpressionType.Modulo;

                    case ICSharpCode.NRefactory.CSharp.BinaryOperatorType.Multiply:

                        return ExpressionType.Multiply;

                    case ICSharpCode.NRefactory.CSharp.BinaryOperatorType.NullCoalescing:

                        return ExpressionType.Coalesce;

                    case ICSharpCode.NRefactory.CSharp.BinaryOperatorType.ShiftLeft:

                        return ExpressionType.LeftShift;

                    case ICSharpCode.NRefactory.CSharp.BinaryOperatorType.ShiftRight:

                        return ExpressionType.RightShift;
                }
            }

            return type;
        }
开发者ID:sagifogel,项目名称:NJection.LambdaConverter,代码行数:61,代码来源:Binary.cs


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