Grumson.Utilities.Timers.DateTimeTimers 1.0.1

dotnet add package Grumson.Utilities.Timers.DateTimeTimers --version 1.0.1                
NuGet\Install-Package Grumson.Utilities.Timers.DateTimeTimers -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="Grumson.Utilities.Timers.DateTimeTimers" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Grumson.Utilities.Timers.DateTimeTimers --version 1.0.1                
#r "nuget: Grumson.Utilities.Timers.DateTimeTimers, 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.
// Install Grumson.Utilities.Timers.DateTimeTimers as a Cake Addin
#addin nuget:?package=Grumson.Utilities.Timers.DateTimeTimers&version=1.0.1

// Install Grumson.Utilities.Timers.DateTimeTimers as a Cake Tool
#tool nuget:?package=Grumson.Utilities.Timers.DateTimeTimers&version=1.0.1                

DateTimeTimer Class Documentation

The DateTimeTimer class is a utility class that provides event-based notifications at the start of new: - second, - minute, - hour, - day, - week, - month, - year.

It is useful for applications that need to perform actions at specific times.

Properties

DayOfWeek

  • Type: string
  • Description: Gets the current day of the week as a three-letter abbreviation.

Events

The DateTimeTimer class provides the following events:

NewSecond

  • Type: NewDateTimeDelegate
  • Description: Event raised every time a new second starts.

NewMinute

  • Type: NewDateTimeDelegate
  • Description: Event raised every time a new minute starts.

NewHour

  • Type: NewDateTimeDelegate
  • Description: Event raised every time a new hour starts.

NewDay

  • Type: NewDateTimeDelegate
  • Description: Event raised every time a new day starts.

NewWeek

  • Type: NewDateTimeDelegate
  • Description: Event raised every time a new week starts.

NewMonth

  • Type: NewDateTimeDelegate
  • Description: Event raised every time a new month starts.

NewYear

  • Type: NewDateTimeDelegate
  • Description: Event raised every time a new year starts.

Methods

Start()

  • Description: Starts the DateTimeTimer and initializes the necessary timers and properties.

Stop()

  • Description: Stops the DateTimeTimer and stops the timers.

Example Usage

Here is an example of how to use the DateTimeTimer class to get events for new second and minute started:


DateTimeTimer timer = new DateTimeTimer();

timer.NewSecond += (value) => {
    Console.WriteLine("New second started: " + value);
};

timer.NewMinute += (value) => {
    Console.WriteLine("New minute started: " + value);
};

timer.Start();

Changelog

Version 1.0.0 - 2023-07-26

  • Some minor bug fixes and improvements.

Version 1.0.0 - 2023-07-26

  • Initial release of the DateTimeTimer.
Product Compatible and additional computed target framework versions.
.NET 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.
  • 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.1 104 7/27/2024
1.0.0 96 7/26/2024