SyntaxExtensions.WithMembers Method
Containing Type: SyntaxExtensions
Assembly: Roslynator.CSharp.dll
Overloads
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
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
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
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
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
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
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
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
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
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
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
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