ktsu.CodeBlocker 1.0.14

Prefix Reserved
dotnet add package ktsu.CodeBlocker --version 1.0.14                
NuGet\Install-Package ktsu.CodeBlocker -Version 1.0.14                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ktsu.CodeBlocker" Version="1.0.14" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ktsu.CodeBlocker --version 1.0.14                
#r "nuget: ktsu.CodeBlocker, 1.0.14"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ktsu.CodeBlocker as a Cake Addin
#addin nuget:?package=ktsu.CodeBlocker&version=1.0.14

// Install ktsu.CodeBlocker as a Cake Tool
#tool nuget:?package=ktsu.CodeBlocker&version=1.0.14                

CodeBlocker

An IndentedTextWriter that makes generating code blocks easier.

Usage

namespace CodeBlockerExample;

using ktsu.CodeBlocker;

internal class Example
{
	public static void GenerateCode()
	{
		using var codeBlocker = CodeBlocker.Create();

		codeBlocker.WriteLine("using System;");
		codeBlocker.NewLine();
		codeBlocker.WriteLine("namespace Example");
		using (new Scope(codeBlocker))
		{
			codeBlocker.WriteLine("public class Example");
			using (new Scope(codeBlocker))
			{
				codeBlocker.WriteLine("public static void Main()");
				using (new Scope(codeBlocker))
				{
					codeBlocker.WriteLine("Console.WriteLine(\"Hello, World!\");");
				}
			}
		}

		Console.WriteLine(codeBlocker.ToString());
	}
}
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.14 39 11/26/2024
1.0.13 78 11/20/2024
1.0.12 70 11/13/2024
1.0.11 72 11/1/2024
1.0.10 86 10/4/2024
1.0.9 85 9/19/2024
1.0.8 72 9/19/2024
1.0.7 74 9/19/2024
1.0.6 77 9/19/2024
1.0.5 89 9/18/2024
1.0.4 81 9/18/2024
1.0.3 82 9/18/2024
1.0.2 88 9/18/2024
1.0.1 95 9/14/2024
1.0.0 104 9/14/2024