protected StatementSyntax GenerateInitializerForControl(string propertyName, string selector, string typeName) { return(SyntaxFactory.ExpressionStatement( SyntaxFactory.AssignmentExpression( SyntaxKind.SimpleAssignmentExpression, SyntaxFactory.IdentifierName(propertyName), SyntaxFactory.ObjectCreationExpression(SyntaxFactory.ParseTypeName(typeName)) .WithArgumentList(SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(new[] { SyntaxFactory.Argument(SyntaxFactory.IdentifierName("webDriver")), SyntaxFactory.Argument(SyntaxFactory.ThisExpression()), SyntaxFactory.Argument(RoslynHelper.GetPathSelectorObjectInitialization(selector)) }))) ) )); }
protected StatementSyntax GenerateInitializerForProxy(SeleniumGeneratorContext context, string typeName, params string[] genericTypeNames) { return(SyntaxFactory.ExpressionStatement( SyntaxFactory.AssignmentExpression( SyntaxKind.SimpleAssignmentExpression, SyntaxFactory.IdentifierName(context.UniqueName), SyntaxFactory.ObjectCreationExpression(RoslynHelper.ParseTypeName(typeName, genericTypeNames)) .WithArgumentList( SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList(new[] { SyntaxFactory.Argument(SyntaxFactory.ThisExpression()), SyntaxFactory.Argument(RoslynHelper.GetPathSelectorObjectInitialization(context.Selector)) })) ) ) )); }