Skip to content

Instantly share code, notes, and snippets.

@controlflow
Last active January 9, 2017 20:53
Show Gist options
  • Save controlflow/17e1c71de33cbb9bb48936522680f389 to your computer and use it in GitHub Desktop.
Save controlflow/17e1c71de33cbb9bb48936522680f389 to your computer and use it in GitHub Desktop.
public override string Text
{
get
{
if ((myValue == ConstantExpressionValue.TRUE &&
(ConditionalAndExpressionNavigator.GetByLeftOperand(myExpression) != null ||
ConditionalAndExpressionNavigator.GetByRightOperand(myExpression) != null))
||
(myValue == ConstantExpressionValue.FALSE &&
(ConditionalOrExpressionNavigator.GetByRightOperand(myExpression) != null ||
ConditionalOrExpressionNavigator.GetByLeftOperand(myExpression) != null)))
{
return "Remove expression";
}
return string.Format("Replace expression with '{0}'", StringValue);
}
}
public override string Text
{
get
{
switch (myValue)
{
case ConstantExpressionValue.TRUE
when ConditionalAndExpressionNavigator.GetByLeftOperand(myExpression) != null
|| ConditionalAndExpressionNavigator.GetByRightOperand(myExpression) != null:
case ConstantExpressionValue.FALSE
when ConditionalOrExpressionNavigator.GetByRightOperand(myExpression) != null
|| ConditionalOrExpressionNavigator.GetByLeftOperand(myExpression) != null:
return "Remove expression";
default:
return string.Format("Replace expression with '{0}'", StringValue);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment