private void ConnectCase([NotNull] SwitchInfo source, [NotNull] CaseInfo caseInfo) { var statement = ExpressionStatement( InvocationExpression( MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, InvocationExpression( MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, IdentifierName(myVariableManager.GetVariableOf(source)), IdentifierName("ConnectCase"))) .WithArgumentList( ArgumentList( SingletonSeparatedList( Argument( caseInfo.ValueExpression.ToExpression())))), IdentifierName("To"))) .WithArgumentList( ArgumentList( SingletonSeparatedList( Argument( IdentifierName(myVariableManager.GetVariableOf(caseInfo.Handler))))))); myStatements.Add(statement); }
public SwitchInfo AddCase([NotNull] CaseInfo caseInfo) { Cases.Add(caseInfo.NotNull()); return(this); }