Exemple #1
0
 protected MemberDeclarationSyntax GeneratePropertyForProxy(string uniqueName, string typeName, params string[] genericTypeNames)
 {
     return(SyntaxFactory.PropertyDeclaration(
                RoslynHelper.ParseTypeName(typeName, genericTypeNames),
                uniqueName
                )
            .WithModifiers(SyntaxFactory.TokenList(SyntaxFactory.Token(SyntaxKind.PublicKeyword)))
            .AddAccessorListAccessors(
                SyntaxFactory.AccessorDeclaration(SyntaxKind.GetAccessorDeclaration)
                .WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken))
                ));
 }
Exemple #2
0
 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))
     }))
                        )
                    )
                ));
 }