本文整理汇总了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;
}
示例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;
}