Redpoint.ProgressMonitor 2025.1216.396

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Redpoint.ProgressMonitor --version 2025.1216.396
                    
NuGet\Install-Package Redpoint.ProgressMonitor -Version 2025.1216.396
                    
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="Redpoint.ProgressMonitor" Version="2025.1216.396" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Redpoint.ProgressMonitor" Version="2025.1216.396" />
                    
Directory.Packages.props
<PackageReference Include="Redpoint.ProgressMonitor" />
                    
Project file
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 Redpoint.ProgressMonitor --version 2025.1216.396
                    
#r "nuget: Redpoint.ProgressMonitor, 2025.1216.396"
                    
#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 Redpoint.ProgressMonitor@2025.1216.396
                    
#: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=Redpoint.ProgressMonitor&version=2025.1216.396
                    
Install as a Cake Addin
#tool nuget:?package=Redpoint.ProgressMonitor&version=2025.1216.396
                    
Install as a Cake Tool

Redpoint.ProgressMonitor

This library provides APIs for monitoring and reporting the progress of arbitrary operations in console applications.

Read on for the following examples:

Example for a generic stream

You can monitor an operation that uses a stream like so:

// Inject these services.
IProgressFactory _progressFactory;
IMonitorFactory _monitorFactory;

using (var stream = new FileStream(...))
{
    // Start monitoring.
    var cts = new CancellationTokenSource();
    var progress = _progressFactory.CreateProgressForStream(stream);
    var monitorTask = Task.Run(async () =>
    {
        var monitor = _monitorFactory.CreateByteBasedMonitor();
        await monitor.MonitorAsync(
            progress,
            SystemConsole.ConsoleInformation,
            SystemConsole.WriteProgressToConsole,
            cts.Token);
    });

    // e.g. hash the stream.
    byte[] hashBytes;
    using (var hasher = SHA256.Create())
    {
        hashBytes = await hasher.ComputeHashAsync(stream);
    }

    // Stop monitoring.
    await SystemConsole.CancelAndWaitForConsoleMonitoringTaskAsync(monitorTask, cts);
}

Example for a HTTP download

If you're reporting progress on a HTTP stream, there's a few extra things to keep in mind:

  • You need to pass HttpCompletionOption.ResponseHeadersRead as the completion option, or HttpClient will buffer the entire response by default.
  • You need to wrap the stream you read from in PositionAwareStream, which is a class provided by this library. Since the underlying HTTP stream does not support Position or Length, this wrapping stream tracks the position as the stream is read from and allows the length to be passed in as a constructor parameter (which you should set based on the Content-Length header).

Below is a concise example of how to show the progress of downloading a file:

using (var client = new HttpClient())
{
    using (var target = new FileStream(targetPath, FileMode.Create, FileAccess.Write, FileShare.None))
    {
        var response = await client.GetAsync(downloadUrl, HttpCompletionOption.ResponseHeadersRead);
        using (var stream = new PositionAwareStream(
            await response.Content.ReadAsStreamAsync(),
            response.Content.Headers.ContentLength!.Value))
        {
            var cts = new CancellationTokenSource();
            var progress = _progressFactory.CreateProgressForStream(stream);
            var monitorTask = Task.Run(async () =>
            {
                var monitor = _monitorFactory.CreateByteBasedMonitor();
                await monitor.MonitorAsync(
                    progress,
                    SystemConsole.ConsoleInformation,
                    SystemConsole.WriteProgressToConsole,
                    cts.Token);
            });

            await stream.CopyToAsync(target);
            
            await SystemConsole.CancelAndWaitForConsoleMonitoringTaskAsync(monitorTask, cts);
        }
    }
}

The SystemConsole static class

The SystemConsole type provides common values for monitoring parameters, such as the current console information and rendering progress information to the console. You should replace the static values in the examples above with your own callbacks and values if you're not rendering progress to the console.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Redpoint.ProgressMonitor:

Package Downloads
Redpoint.PackageManagement

Provides APIs for installing, upgrading and uninstalling packages with WinGet and Homebrew.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2025.1222.437 0 8/10/2025
2025.1222.425 0 8/10/2025
2025.1220.271 133 8/8/2025
2025.1220.225 132 8/8/2025
2025.1220.80 141 8/8/2025
2025.1219.568 145 8/7/2025
2025.1219.546 148 8/7/2025
2025.1219.514 146 8/7/2025
2025.1219.513 144 8/7/2025
2025.1219.511 145 8/7/2025
2025.1219.421 146 8/7/2025
2025.1219.377 146 8/7/2025
2025.1219.362 148 8/7/2025
2025.1219.361 145 8/7/2025
2025.1218.1281 146 8/6/2025
2025.1218.1266 145 8/6/2025
2025.1218.1264 146 8/6/2025
2025.1218.1255 145 8/6/2025
2025.1218.1223 146 8/6/2025
2025.1218.1180 146 8/6/2025
2025.1218.1166 144 8/6/2025
2025.1218.1154 145 8/6/2025
2025.1218.1088 147 8/6/2025
2025.1218.595 146 8/6/2025
2025.1218.554 146 8/6/2025
2025.1218.544 146 8/6/2025
2025.1218.523 144 8/6/2025
2025.1218.499 146 8/6/2025
2025.1218.427 147 8/6/2025
2025.1218.415 146 8/6/2025
2025.1218.187 149 8/6/2025
2025.1218.174 146 8/6/2025
2025.1218.148 147 8/6/2025
2025.1218.123 145 8/6/2025
2025.1217.886 151 8/5/2025
2025.1217.560 152 8/5/2025
2025.1217.516 154 8/5/2025
2025.1217.512 154 8/5/2025
2025.1217.503 157 8/5/2025
2025.1216.1103 154 8/4/2025
2025.1216.1025 152 8/4/2025
2025.1216.978 135 8/4/2025
2025.1216.897 136 8/4/2025
2025.1216.893 137 8/4/2025
2025.1216.884 140 8/4/2025
2025.1216.873 136 8/4/2025
2025.1216.824 137 8/4/2025
2025.1216.767 136 8/4/2025
2025.1216.745 140 8/4/2025
2025.1216.411 115 8/4/2025
2025.1216.396 114 8/4/2025
2025.1216.386 114 8/4/2025
2025.1216.357 114 8/4/2025
2025.1216.347 113 8/4/2025
2025.1216.334 115 8/4/2025
2025.1216.319 111 8/4/2025
2025.1215.930 81 8/3/2025
2025.1215.928 84 8/3/2025
2025.1215.911 85 8/3/2025
2025.1215.892 83 8/3/2025
2025.1215.842 84 8/3/2025
2025.1209.1064 93 7/28/2025
2025.1209.1061 87 7/28/2025
2025.1209.1047 86 7/28/2025
2025.1209.1038 88 7/28/2025
2025.1209.1034 87 7/28/2025
2025.1209.948 87 7/28/2025
2025.1209.881 90 7/28/2025
2025.1209.773 95 7/28/2025
2025.1209.765 86 7/28/2025
2025.1209.758 90 7/28/2025
2025.1209.727 90 7/28/2025
2025.1209.658 87 7/28/2025
2025.1209.300 86 7/28/2025
2025.1209.284 89 7/28/2025
2025.1209.264 88 7/28/2025
2025.1209.227 86 7/28/2025
2025.1209.198 88 7/28/2025
2025.1209.179 89 7/28/2025
2025.1208.826 98 7/27/2025
2025.1208.627 61 7/27/2025
2025.1208.617 57 7/27/2025
2025.1208.570 58 7/27/2025
2025.1208.568 58 7/27/2025
2025.1208.566 58 7/27/2025
2025.1206.491 389 7/25/2025
2025.1206.247 417 7/25/2025
2025.1205.230 440 7/24/2025
2025.1203.826 488 7/22/2025
2025.1202.906 435 7/21/2025
2025.1202.904 432 7/21/2025
2025.1202.283 358 7/21/2025
2025.1201.470 181 7/20/2025
2025.1199.287 94 7/18/2025
2025.1198.1048 109 7/17/2025
2025.1198.682 108 7/17/2025
2025.1198.638 109 7/17/2025
2025.1198.574 111 7/17/2025
2025.1198.187 114 7/17/2025
2025.1191.922 140 7/10/2025
2025.1191.235 143 7/10/2025
2025.1190.175 143 7/9/2025
2025.1189.851 142 7/8/2025
2025.1189.841 146 7/8/2025
2025.1187.587 144 7/6/2025
2025.1183.853 138 7/2/2025
2025.1181.644 132 6/30/2025
2025.1175.340 142 6/24/2025
2025.1174.62 140 6/23/2025
2025.1171.352 131 6/20/2025
2025.1169.413 143 6/18/2025
2025.1166.1191 140 6/15/2025
2025.1166.1178 143 6/15/2025
2025.1166.1177 144 6/15/2025
2025.1159.445 125 6/8/2025
2025.1159.364 121 6/8/2025
2025.1159.324 123 6/8/2025
2025.1155.438 147 6/4/2025
2025.1141.1424 151 5/21/2025
2025.1140.383 152 5/20/2025
2025.1140.377 152 5/20/2025
2025.1139.983 152 5/19/2025
2025.1139.952 148 5/19/2025
2025.1139.941 152 5/19/2025
2025.1139.855 153 5/19/2025
2025.1139.850 146 5/19/2025
2025.1139.837 146 5/19/2025
2025.1139.811 148 5/19/2025
2025.1139.806 149 5/19/2025
2025.1139.796 150 5/19/2025
2025.1139.729 149 5/19/2025
2025.1139.719 149 5/19/2025
2025.1139.706 150 5/19/2025
2025.1139.694 146 5/19/2025
2025.1139.679 151 5/19/2025
2025.1139.662 147 5/19/2025
2025.1139.638 142 5/19/2025
2025.1139.628 143 5/19/2025
2025.1139.626 150 5/19/2025
2025.1139.619 147 5/19/2025
2025.1139.605 145 5/19/2025
2025.1139.600 147 5/19/2025
2025.1139.583 147 5/19/2025
2025.1139.573 150 5/19/2025
2025.1139.564 145 5/19/2025
2025.1139.552 148 5/19/2025
2025.1139.543 145 5/19/2025
2025.1138.909 149 5/18/2025
2025.1136.150 218 5/16/2025
2025.1135.267 222 5/15/2025
2025.1135.143 228 5/15/2025
2025.1133.453 231 5/13/2025
2025.1133.351 235 5/13/2025
2025.1133.349 241 5/13/2025
2025.1133.347 232 5/13/2025
2025.1130.236 82 5/10/2025
2025.1129.831 112 5/9/2025
2025.1129.346 154 5/9/2025
2023.1176.407 216 6/25/2023
2023.1176.396 178 6/25/2023
2023.1176.363 188 6/25/2023
2023.1176.360 224 6/25/2023
2023.1175.638 183 6/24/2023
2023.1170.907 179 6/19/2023
2023.1170.900 181 6/19/2023
2023.1167.562 182 6/16/2023
2023.1167.556 186 6/16/2023
2023.1167.496 199 6/16/2023
2023.1166.1008 203 6/15/2023
2023.1166.938 175 6/15/2023
2023.1166.713 193 6/15/2023
2023.1166.699 183 6/15/2023
2023.1165.1065 193 6/14/2023
2023.1165.888 190 6/14/2023
2023.1165.878 189 6/14/2023
2023.1165.861 179 6/14/2023
2023.1165.828 190 6/14/2023
2023.1165.686 203 6/14/2023
2023.1165.653 185 6/14/2023
2023.377.1003 275 5/31/2023
2023.377.909 207 5/31/2023
2023.377.558 203 5/31/2023
2023.365.1417 253 5/30/2023
2023.365.1350 191 5/30/2023
2023.365.1327 187 5/30/2023
2023.365.1306 205 5/30/2023
2023.365.1198 216 5/30/2023
2023.365.1046 194 5/30/2023
2023.365.710 193 5/30/2023
2023.365.703 205 5/30/2023
2023.365.336 194 5/30/2023
2023.174.636 191 6/14/2023
2023.174.616 174 6/14/2023
2023.174.442 189 6/14/2023
2023.162.1243 185 6/13/2023
2023.162.1225 192 6/13/2023
2023.162.1023 178 6/13/2023
2023.162.948 183 6/13/2023
2023.162.865 188 6/13/2023
2023.162.770 212 6/13/2023
2023.162.734 202 6/13/2023
2023.162.701 193 6/13/2023
2023.162.470 203 6/13/2023
2023.162.418 186 6/13/2023
2023.150.1142 187 6/12/2023
2023.150.1121 190 6/12/2023
2023.150.1095 191 6/12/2023
2023.150.1081 177 6/12/2023
2023.150.1066 186 6/12/2023
2023.150.999 177 6/12/2023
2023.150.916 204 6/12/2023
2023.150.865 189 6/12/2023
2023.150.831 189 6/12/2023
2023.150.774 187 6/12/2023
2023.150.613 184 6/12/2023
2023.150.558 199 6/12/2023
2023.150.456 210 6/12/2023
2023.150.450 211 6/12/2023
2023.150.220 209 6/12/2023
2023.150.179 214 6/12/2023
2023.150.167 216 6/12/2023
2023.138.864 200 6/11/2023
2023.138.837 195 6/11/2023
2023.138.363 205 6/11/2023
2023.138.224 234 6/11/2023
2023.138.213 179 6/11/2023
2023.126.1167 207 6/11/2023
2023.126.1148 201 6/10/2023
2023.126.838 213 6/10/2023
2023.126.794 206 6/10/2023
2023.126.745 207 6/10/2023
2023.126.714 219 6/10/2023
2023.126.662 215 6/10/2023
2023.114.544 191 6/9/2023
2023.114.351 200 6/9/2023
2023.90.1030 205 6/7/2023
2023.90.1009 188 6/7/2023
2023.54.1152 190 6/4/2023
2023.54.419 211 6/4/2023
2023.54.198 192 6/4/2023
2023.54.60 172 6/4/2023
2023.54.48 205 6/4/2023
2023.42.745 191 6/3/2023
2023.30.1191 191 6/2/2023
2023.30.1172 205 6/2/2023
2023.30.1163 195 6/2/2023
2023.30.1147 201 6/2/2023
2023.30.1136 219 6/2/2023
2023.30.765 213 6/2/2023
2023.30.761 200 6/2/2023
2023.30.747 213 6/2/2023
2023.30.734 201 6/2/2023