Skip to content

doks-coders/CodeFormatterPackage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Codeformatter Package

A Simple Text formatter that formats the contents of a file using the c# style. Watch Video

Installation

  Install-Package CodeFormatterModule

Imports

import the Codeformatter

  using CodeFormatterModule;

API Reference

Format a single file

Pass in the path of the file you want formatted

var formatter = new FormatCode();

try
{
	formatter.FormatCodeFile("File.cs");
}
catch (Exception ex) 
{
	Console.WriteLine(ex.Message);
}
Parameter Type Description
path string Should contain relative path to your file

Format multiple files

Pass in the paths of the file you want formatted in a string array

var formatter = new FormatCode();

try
{
	var files = new string[] { "File1.cs", "File2.cs" };
    	formatter.FormatCodeFile(files);
}
catch (Exception ex) 
{
	Console.WriteLine(ex.Message);
}
Parameter Type Description
paths string [] Should contain relative paths to your files

Format all files in directory and subdirectory

Pass in the path of the folder you want formatted

var formatter = new FormatCode();

try
{
	formatter.FormatCodeFile("Folder",children:true);
}
catch (Exception ex) 
{
	Console.WriteLine(ex.Message);
}
Parameter Type Description
fileDirectory string Should contain relative path to your folder
children boolean Should be used if you want the children of the folder

About

Nuget Package built for formatting cs files

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages