Пример #1
0
        public static ExpressionSyntax BuildCall(RoslynTranslator translator, GetInputNodeModel model, string methodName, out ExpressionSyntax inputName)
        {
            if (model.InputPort.Connected || model.InputPort.EmbeddedValue != null)
            {
                inputName = translator.BuildPort(model.InputPort).FirstOrDefault() as ExpressionSyntax;
            }
            else
            {
                inputName = RoslynBuilder.EmptyStringLiteralExpression();
            }

            var methodParameters = new[] { SyntaxFactory.Argument(inputName) };

            var method = RoslynBuilder.MethodInvocation(methodName, typeof(Input).ToTypeSyntax(), methodParameters, Enumerable.Empty <TypeSyntax>());

            return(method);
        }
Пример #2
0
        public static IEnumerable <SyntaxNode> BuildGetInput(this RoslynTranslator translator, GetInputNodeModel model, IPortModel portModel)
        {
            var method = BuildCall(translator, model, model.MethodName(portModel), out _);

            yield return(method);
        }