C# Class ICSharpCode.NRefactory.CSharp.CSharpUtil

Afficher le fichier Open project: 0xd4d/NRefactory

Méthodes publiques

Méthode Description
AreConditionsEqual ( Expression cond1, Expression cond2 ) : bool
GetInnerMostExpression ( Expression target ) : Expression
InvertCondition ( Expression condition ) : Expression

Inverts a boolean condition. Note: The condition object can be frozen (from AST) it's cloned internally.

IsRelationalOperator ( BinaryOperatorType op ) : bool

Returns true, if the specified operator is a relational operator

NegateConditionOperator ( BinaryOperatorType op ) : BinaryOperatorType

Get negation of the condition operator

NegateRelationalOperator ( BinaryOperatorType op ) : BinaryOperatorType

Get negation of the specified relational operator

Private Methods

Méthode Description
AddParensForUnaryExpressionIfRequired ( Expression expression ) : Expression

When negating an expression this is required, otherwise you would end up with a or b -> !a or b

InvertConditionInternal ( Expression condition ) : Expression

Method Details

AreConditionsEqual() public static méthode

public static AreConditionsEqual ( Expression cond1, Expression cond2 ) : bool
cond1 Expression
cond2 Expression
Résultat bool

GetInnerMostExpression() public static méthode

public static GetInnerMostExpression ( Expression target ) : Expression
target Expression
Résultat Expression

InvertCondition() public static méthode

Inverts a boolean condition. Note: The condition object can be frozen (from AST) it's cloned internally.
public static InvertCondition ( Expression condition ) : Expression
condition Expression The condition to invert.
Résultat Expression

IsRelationalOperator() public static méthode

Returns true, if the specified operator is a relational operator
public static IsRelationalOperator ( BinaryOperatorType op ) : bool
op BinaryOperatorType
Résultat bool

NegateConditionOperator() public static méthode

Get negation of the condition operator
public static NegateConditionOperator ( BinaryOperatorType op ) : BinaryOperatorType
op BinaryOperatorType
Résultat BinaryOperatorType

NegateRelationalOperator() public static méthode

Get negation of the specified relational operator
public static NegateRelationalOperator ( BinaryOperatorType op ) : BinaryOperatorType
op BinaryOperatorType
Résultat BinaryOperatorType