Table of Contents

Class SunamoDevCodeHelper

Namespace
SunamoDevCode
Assembly
SunamoDevCode.dll

Helper methods for common SunamoDevCode operations like file cleanup and solution copying.

public class SunamoDevCodeHelper
Inheritance
SunamoDevCodeHelper
Inherited Members
Extension Methods

Methods

CopySolution(string, string, Action<string>)

Copies a solution folder to a destination, excluding temporary VS files and git files, then creates an archive.

public static void CopySolution(string slnFolder, string folderTo, Action<string> archive)

Parameters

slnFolder string

Source solution folder path.

folderTo string

Destination folder path.

archive Action<string>

Action to create an archive from the copied folder.

IsNameOfControl(string)

A1 normal, not lower

public static bool IsNameOfControl(string between)

Parameters

between string

Returns

bool

IsNameOfHtmlTag(string, bool)

Determines whether the given text is a known HTML tag name, optionally with a numeric suffix.

public static bool IsNameOfHtmlTag(string between, bool add)

Parameters

between string

Text to check against known HTML tags.

add bool

Initial value indicating whether to add (overwritten internally).

Returns

bool

True if the text matches an HTML tag name.

RemoveGitFiles(List<string>, bool, bool, bool)

Removes git-related files and downloaded/temporary folder entries from the file list.

public static void RemoveGitFiles(List<string> files, bool isIncludingGitFiles = true, bool isIncludingDownloadedFolders = false, bool isIncludingFoldersToDelete = false)

Parameters

files List<string>

List of file paths to filter in-place.

isIncludingGitFiles bool

Whether to keep git files (true) or remove them (false).

isIncludingDownloadedFolders bool

Whether to keep downloaded folders (true) or remove them (false).

isIncludingFoldersToDelete bool

Whether to keep folders marked for deletion (true) or remove them (false).

RemoveTemporaryFilesVS(List<string>)

Removes Visual Studio temporary files (bin, obj, packages, etc.) from the file list.

public static void RemoveTemporaryFilesVS(List<string> files)

Parameters

files List<string>

List of file paths to filter in-place.

TryDeleteDirectory(ILogger, string)

Attempts to delete a directory. If the first attempt fails, normalizes file attributes and retries.

public static bool TryDeleteDirectory(ILogger logger, string directoryPath)

Parameters

logger ILogger

Logger instance.

directoryPath string

Path to the directory to delete.

Returns

bool

True if the directory was successfully deleted or does not exist.