Skip to main content

SyntaxExtensions.WithMembers Method

Containing Type: SyntaxExtensions

Assembly: Roslynator.CSharp.dll

Overloads

MethodSummary
WithMembers(ClassDeclarationSyntax, IEnumerable<MemberDeclarationSyntax>)Creates a new ClassDeclarationSyntax with the members updated.
WithMembers(ClassDeclarationSyntax, MemberDeclarationSyntax)Creates a new ClassDeclarationSyntax with the members updated.
WithMembers(CompilationUnitSyntax, IEnumerable<MemberDeclarationSyntax>)Creates a new CompilationUnitSyntax with the members updated.
WithMembers(CompilationUnitSyntax, MemberDeclarationSyntax)Creates a new CompilationUnitSyntax with the members updated.
WithMembers(InterfaceDeclarationSyntax, IEnumerable<MemberDeclarationSyntax>)Creates a new InterfaceDeclarationSyntax with the members updated.
WithMembers(InterfaceDeclarationSyntax, MemberDeclarationSyntax)Creates a new InterfaceDeclarationSyntax with the members updated.
WithMembers(NamespaceDeclarationSyntax, IEnumerable<MemberDeclarationSyntax>)Creates a new NamespaceDeclarationSyntax with the members updated.
WithMembers(NamespaceDeclarationSyntax, MemberDeclarationSyntax)Creates a new NamespaceDeclarationSyntax with the members updated.
WithMembers(RecordDeclarationSyntax, IEnumerable<MemberDeclarationSyntax>)Creates a new RecordDeclarationSyntax with the members updated.
WithMembers(RecordDeclarationSyntax, MemberDeclarationSyntax)Creates a new RecordDeclarationSyntax with the members updated.
WithMembers(StructDeclarationSyntax, IEnumerable<MemberDeclarationSyntax>)Creates a new StructDeclarationSyntax with the members updated.
WithMembers(StructDeclarationSyntax, MemberDeclarationSyntax)Creates a new StructDeclarationSyntax with the members updated.

WithMembers(ClassDeclarationSyntax, IEnumerable<MemberDeclarationSyntax>)

Creates a new ClassDeclarationSyntax with the members updated.

public static Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax WithMembers(this Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax classDeclaration, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax> members)

Parameters

classDeclaration ClassDeclarationSyntax

members IEnumerable<MemberDeclarationSyntax>

Returns

ClassDeclarationSyntax

WithMembers(ClassDeclarationSyntax, MemberDeclarationSyntax)

Creates a new ClassDeclarationSyntax with the members updated.

public static Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax WithMembers(this Microsoft.CodeAnalysis.CSharp.Syntax.ClassDeclarationSyntax classDeclaration, Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax member)

Parameters

classDeclaration ClassDeclarationSyntax

member MemberDeclarationSyntax

Returns

ClassDeclarationSyntax

WithMembers(CompilationUnitSyntax, IEnumerable<MemberDeclarationSyntax>)

Creates a new CompilationUnitSyntax with the members updated.

public static Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax WithMembers(this Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax compilationUnit, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax> members)

Parameters

compilationUnit CompilationUnitSyntax

members IEnumerable<MemberDeclarationSyntax>

Returns

CompilationUnitSyntax

WithMembers(CompilationUnitSyntax, MemberDeclarationSyntax)

Creates a new CompilationUnitSyntax with the members updated.

public static Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax WithMembers(this Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax compilationUnit, Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax member)

Parameters

compilationUnit CompilationUnitSyntax

member MemberDeclarationSyntax

Returns

CompilationUnitSyntax

WithMembers(InterfaceDeclarationSyntax, IEnumerable<MemberDeclarationSyntax>)

Creates a new InterfaceDeclarationSyntax with the members updated.

public static Microsoft.CodeAnalysis.CSharp.Syntax.InterfaceDeclarationSyntax WithMembers(this Microsoft.CodeAnalysis.CSharp.Syntax.InterfaceDeclarationSyntax interfaceDeclaration, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax> members)

Parameters

interfaceDeclaration InterfaceDeclarationSyntax

members IEnumerable<MemberDeclarationSyntax>

Returns

InterfaceDeclarationSyntax

WithMembers(InterfaceDeclarationSyntax, MemberDeclarationSyntax)

Creates a new InterfaceDeclarationSyntax with the members updated.

public static Microsoft.CodeAnalysis.CSharp.Syntax.InterfaceDeclarationSyntax WithMembers(this Microsoft.CodeAnalysis.CSharp.Syntax.InterfaceDeclarationSyntax interfaceDeclaration, Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax member)

Parameters

interfaceDeclaration InterfaceDeclarationSyntax

member MemberDeclarationSyntax

Returns

InterfaceDeclarationSyntax

WithMembers(NamespaceDeclarationSyntax, IEnumerable<MemberDeclarationSyntax>)

Creates a new NamespaceDeclarationSyntax with the members updated.

public static Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax WithMembers(this Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax namespaceDeclaration, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax> members)

Parameters

namespaceDeclaration NamespaceDeclarationSyntax

members IEnumerable<MemberDeclarationSyntax>

Returns

NamespaceDeclarationSyntax

WithMembers(NamespaceDeclarationSyntax, MemberDeclarationSyntax)

Creates a new NamespaceDeclarationSyntax with the members updated.

public static Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax WithMembers(this Microsoft.CodeAnalysis.CSharp.Syntax.NamespaceDeclarationSyntax namespaceDeclaration, Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax member)

Parameters

namespaceDeclaration NamespaceDeclarationSyntax

member MemberDeclarationSyntax

Returns

NamespaceDeclarationSyntax

WithMembers(RecordDeclarationSyntax, IEnumerable<MemberDeclarationSyntax>)

Creates a new RecordDeclarationSyntax with the members updated.

public static Microsoft.CodeAnalysis.CSharp.Syntax.RecordDeclarationSyntax WithMembers(this Microsoft.CodeAnalysis.CSharp.Syntax.RecordDeclarationSyntax recordDeclaration, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax> members)

Parameters

recordDeclaration RecordDeclarationSyntax

members IEnumerable<MemberDeclarationSyntax>

Returns

RecordDeclarationSyntax

WithMembers(RecordDeclarationSyntax, MemberDeclarationSyntax)

Creates a new RecordDeclarationSyntax with the members updated.

public static Microsoft.CodeAnalysis.CSharp.Syntax.RecordDeclarationSyntax WithMembers(this Microsoft.CodeAnalysis.CSharp.Syntax.RecordDeclarationSyntax recordDeclaration, Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax member)

Parameters

recordDeclaration RecordDeclarationSyntax

member MemberDeclarationSyntax

Returns

RecordDeclarationSyntax

WithMembers(StructDeclarationSyntax, IEnumerable<MemberDeclarationSyntax>)

Creates a new StructDeclarationSyntax with the members updated.

public static Microsoft.CodeAnalysis.CSharp.Syntax.StructDeclarationSyntax WithMembers(this Microsoft.CodeAnalysis.CSharp.Syntax.StructDeclarationSyntax structDeclaration, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax> members)

Parameters

structDeclaration StructDeclarationSyntax

members IEnumerable<MemberDeclarationSyntax>

Returns

StructDeclarationSyntax

WithMembers(StructDeclarationSyntax, MemberDeclarationSyntax)

Creates a new StructDeclarationSyntax with the members updated.

public static Microsoft.CodeAnalysis.CSharp.Syntax.StructDeclarationSyntax WithMembers(this Microsoft.CodeAnalysis.CSharp.Syntax.StructDeclarationSyntax structDeclaration, Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax member)

Parameters

structDeclaration StructDeclarationSyntax

member MemberDeclarationSyntax

Returns

StructDeclarationSyntax