Table of Contents

Class AddOrEditNamespaceService

Namespace
SunamoDevCode.Services
Assembly
SunamoDevCode.dll

Service for adding or editing file-scoped namespace declarations in C# source files.

public class AddOrEditNamespaceService
Inheritance
AddOrEditNamespaceService
Inherited Members
Extension Methods

Fields

classCodeElements

Keywords that indicate the start of a type declaration in C# source code.

public readonly List<string> classCodeElements

Field Value

List<string>

Methods

AddOrEditNamespaceForSingleFileAndSave(string, string, string, List<string>?, string?)

Adds or edits namespace declaration in a single C# file and saves it

public Task<string?> AddOrEditNamespaceForSingleFileAndSave(string pathToCsprojFolder, string projectName, string csPath, List<string>? linesFile = null, string? pathToSave = null)

Parameters

pathToCsprojFolder string

Path to csproj folder

projectName string

Project name for namespace

csPath string

Path to C# file

linesFile List<string>

Optional pre-loaded file lines

pathToSave string

Optional alternative save path

Returns

Task<string>

New namespace or null if file was skipped