ktsu.CodeBlocker 1.0.10

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package ktsu.CodeBlocker --version 1.0.10                
NuGet\Install-Package ktsu.CodeBlocker -Version 1.0.10                
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.10" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ktsu.CodeBlocker --version 1.0.10                
#r "nuget: ktsu.CodeBlocker, 1.0.10"                
#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.10

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

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.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.31-pre.3 42 2/6/2025
1.0.31-pre.2 35 2/5/2025
1.0.31-pre.1 34 2/5/2025
1.0.30 90 1/2/2025
1.0.30-pre.29 38 2/3/2025
1.0.30-pre.28 32 2/3/2025
1.0.30-pre.27 35 2/1/2025
1.0.30-pre.26 35 1/30/2025
1.0.30-pre.25 33 1/28/2025
1.0.30-pre.24 31 1/26/2025
1.0.30-pre.23 14 1/24/2025
1.0.30-pre.22 28 1/22/2025
1.0.30-pre.21 31 1/20/2025
1.0.30-pre.20 33 1/18/2025
1.0.30-pre.19 35 1/16/2025
1.0.30-pre.18 11 1/14/2025
1.0.30-pre.17 27 1/13/2025
1.0.30-pre.16 39 1/11/2025
1.0.30-pre.15 35 1/10/2025
1.0.30-pre.14 39 1/10/2025
1.0.30-pre.13 16 1/8/2025
1.0.30-pre.12 43 1/7/2025
1.0.30-pre.11 48 1/6/2025
1.0.30-pre.10 66 1/4/2025
1.0.30-pre.9 49 1/3/2025
1.0.30-pre.8 49 1/3/2025
1.0.30-pre.7 52 1/3/2025
1.0.30-pre.6 58 1/2/2025
1.0.30-pre.5 76 12/31/2024
1.0.30-pre.4 49 12/29/2024
1.0.30-pre.3 46 12/28/2024
1.0.30-pre.2 55 12/27/2024
1.0.30-pre.1 44 12/27/2024
1.0.29-pre.1 44 12/27/2024
1.0.28 86 12/26/2024
1.0.27 83 12/26/2024
1.0.26 86 12/26/2024
1.0.25 87 12/26/2024
1.0.24 86 12/26/2024
1.0.23 90 12/26/2024
1.0.22 89 12/26/2024
1.0.21 84 12/23/2024
1.0.20 85 12/23/2024
1.0.19 94 12/22/2024
1.0.18 83 12/22/2024
1.0.17 95 12/4/2024
1.0.16 94 12/2/2024
1.0.15 96 11/30/2024
1.0.14 94 11/26/2024
1.0.13 104 11/20/2024
1.0.12 99 11/13/2024
1.0.11 92 11/1/2024
1.0.10 100 10/4/2024
1.0.10-pre.1 49 12/27/2024
1.0.9 99 9/19/2024
1.0.8 84 9/19/2024
1.0.7 88 9/19/2024
1.0.6 93 9/19/2024
1.0.5 103 9/18/2024
1.0.4 95 9/18/2024
1.0.3 98 9/18/2024
1.0.2 102 9/18/2024
1.0.1 110 9/14/2024
1.0.0 116 9/14/2024