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
slnFolderstringSource solution folder path.
folderTostringDestination folder path.
archiveAction<string>Action to create an archive from the copied folder.
IsNameOfControl(string)
A1 normal, not lower
public static bool IsNameOfControl(string between)
Parameters
betweenstring
Returns
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
betweenstringText to check against known HTML tags.
addboolInitial 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
filesList<string>List of file paths to filter in-place.
isIncludingGitFilesboolWhether to keep git files (true) or remove them (false).
isIncludingDownloadedFoldersboolWhether to keep downloaded folders (true) or remove them (false).
isIncludingFoldersToDeleteboolWhether 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
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
Returns
- bool
True if the directory was successfully deleted or does not exist.