ktsu.CodeBlocker
1.0.1
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package ktsu.CodeBlocker --version 1.0.1
NuGet\Install-Package ktsu.CodeBlocker -Version 1.0.1
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.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ktsu.CodeBlocker" Version="1.0.1" />
<PackageReference Include="ktsu.CodeBlocker" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ktsu.CodeBlocker --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ktsu.CodeBlocker, 1.0.1"
#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.
#:package ktsu.CodeBlocker@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ktsu.CodeBlocker&version=1.0.1
#tool nuget:?package=ktsu.CodeBlocker&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 | Versions 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. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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.1.8-pre.3 | 137 | 11/24/2025 |
| 1.1.8-pre.2 | 118 | 11/23/2025 |
| 1.1.8-pre.1 | 91 | 11/23/2025 |
| 1.1.7 | 214 | 11/14/2025 |
| 1.1.6 | 398 | 8/6/2025 |
| 1.1.5 | 271 | 8/6/2025 |
| 1.1.4 | 264 | 8/6/2025 |
| 1.1.3 | 257 | 8/6/2025 |
| 1.1.2 | 265 | 8/6/2025 |
| 1.1.2-pre.17 | 152 | 5/20/2025 |
| 1.1.2-pre.15 | 107 | 5/17/2025 |
| 1.1.2-pre.14 | 152 | 5/16/2025 |
| 1.1.2-pre.13 | 226 | 5/15/2025 |
| 1.1.2-pre.12 | 229 | 5/14/2025 |
| 1.1.2-pre.11 | 227 | 5/13/2025 |
| 1.1.2-pre.10 | 254 | 5/12/2025 |
| 1.1.2-pre.9 | 187 | 5/11/2025 |
| 1.1.2-pre.8 | 140 | 5/10/2025 |
| 1.1.2-pre.7 | 77 | 5/9/2025 |
| 1.1.2-pre.6 | 150 | 5/8/2025 |
| 1.1.2-pre.5 | 153 | 5/7/2025 |
| 1.1.2-pre.4 | 150 | 5/6/2025 |
| 1.1.2-pre.3 | 146 | 5/5/2025 |
| 1.1.2-pre.2 | 144 | 5/4/2025 |
| 1.1.2-pre.1 | 149 | 5/4/2025 |
| 1.1.1 | 189 | 5/4/2025 |
| 1.1.1-pre.2 | 84 | 4/26/2025 |
| 1.1.1-pre.1 | 146 | 4/4/2025 |
| 1.1.0 | 186 | 3/30/2025 |
| 1.0.32-pre.2 | 106 | 3/29/2025 |
| 1.0.32-pre.1 | 482 | 3/25/2025 |
| 1.0.31 | 174 | 2/17/2025 |
| 1.0.31-pre.3 | 109 | 2/6/2025 |
| 1.0.31-pre.2 | 94 | 2/5/2025 |
| 1.0.31-pre.1 | 88 | 2/5/2025 |
| 1.0.30 | 146 | 1/2/2025 |
| 1.0.30-pre.29 | 95 | 2/3/2025 |
| 1.0.30-pre.28 | 101 | 2/3/2025 |
| 1.0.30-pre.27 | 99 | 2/1/2025 |
| 1.0.30-pre.26 | 93 | 1/30/2025 |
| 1.0.30-pre.25 | 99 | 1/28/2025 |
| 1.0.30-pre.24 | 92 | 1/26/2025 |
| 1.0.30-pre.23 | 91 | 1/24/2025 |
| 1.0.30-pre.22 | 89 | 1/22/2025 |
| 1.0.30-pre.21 | 93 | 1/20/2025 |
| 1.0.30-pre.20 | 86 | 1/18/2025 |
| 1.0.30-pre.19 | 89 | 1/16/2025 |
| 1.0.30-pre.18 | 73 | 1/14/2025 |
| 1.0.30-pre.17 | 85 | 1/13/2025 |
| 1.0.30-pre.16 | 85 | 1/11/2025 |
| 1.0.30-pre.15 | 82 | 1/10/2025 |
| 1.0.30-pre.14 | 91 | 1/10/2025 |
| 1.0.30-pre.13 | 81 | 1/8/2025 |
| 1.0.30-pre.12 | 87 | 1/7/2025 |
| 1.0.30-pre.11 | 93 | 1/6/2025 |
| 1.0.30-pre.10 | 104 | 1/4/2025 |
| 1.0.30-pre.9 | 99 | 1/3/2025 |
| 1.0.30-pre.8 | 91 | 1/3/2025 |
| 1.0.30-pre.7 | 95 | 1/3/2025 |
| 1.0.30-pre.6 | 108 | 1/2/2025 |
| 1.0.30-pre.5 | 120 | 12/31/2024 |
| 1.0.30-pre.4 | 89 | 12/29/2024 |
| 1.0.30-pre.3 | 89 | 12/28/2024 |
| 1.0.30-pre.2 | 99 | 12/27/2024 |
| 1.0.30-pre.1 | 89 | 12/27/2024 |
| 1.0.29-pre.1 | 96 | 12/27/2024 |
| 1.0.28 | 149 | 12/26/2024 |
| 1.0.27 | 149 | 12/26/2024 |
| 1.0.26 | 155 | 12/26/2024 |
| 1.0.25 | 159 | 12/26/2024 |
| 1.0.24 | 145 | 12/26/2024 |
| 1.0.23 | 151 | 12/26/2024 |
| 1.0.22 | 156 | 12/26/2024 |
| 1.0.21 | 152 | 12/23/2024 |
| 1.0.20 | 150 | 12/23/2024 |
| 1.0.19 | 162 | 12/22/2024 |
| 1.0.18 | 158 | 12/22/2024 |
| 1.0.17 | 157 | 12/4/2024 |
| 1.0.16 | 159 | 12/2/2024 |
| 1.0.15 | 159 | 11/30/2024 |
| 1.0.14 | 142 | 11/26/2024 |
| 1.0.13 | 164 | 11/20/2024 |
| 1.0.12 | 162 | 11/13/2024 |
| 1.0.11 | 156 | 11/1/2024 |
| 1.0.10 | 157 | 10/4/2024 |
| 1.0.10-pre.1 | 90 | 12/27/2024 |
| 1.0.9 | 145 | 9/19/2024 |
| 1.0.8 | 136 | 9/19/2024 |
| 1.0.7 | 142 | 9/19/2024 |
| 1.0.6 | 155 | 9/19/2024 |
| 1.0.5 | 150 | 9/18/2024 |
| 1.0.4 | 158 | 9/18/2024 |
| 1.0.3 | 141 | 9/18/2024 |
| 1.0.2 | 153 | 9/18/2024 |
| 1.0.1 | 160 | 9/14/2024 |
| 1.0.0 | 176 | 9/14/2024 |