Skip to main content

SyntaxExtensions.AddUsings(CompilationUnitSyntax, Boolean, UsingDirectiveSyntax[]) Method

Containing Type: SyntaxExtensions

Assembly: Roslynator.CSharp.dll

Creates a new CompilationUnitSyntax with the specified using directives added.

public static Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax AddUsings(this Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax compilationUnit, bool keepSingleLineCommentsOnTop, params Microsoft.CodeAnalysis.CSharp.Syntax.UsingDirectiveSyntax[] usings)

Parameters

compilationUnit CompilationUnitSyntax

keepSingleLineCommentsOnTop Boolean

usings UsingDirectiveSyntax[]

Returns

CompilationUnitSyntax