Cron.Core.StrongNamed
1.21.1.2310
Cron builder object that can be used to build Cron expressions, describe them, and manipulate objects.
Install-Package Cron.Core.StrongNamed -Version 1.21.1.2310
dotnet add package Cron.Core.StrongNamed --version 1.21.1.2310
<PackageReference Include="Cron.Core.StrongNamed" Version="1.21.1.2310" />
paket add Cron.Core.StrongNamed --version 1.21.1.2310
#r "nuget: Cron.Core.StrongNamed, 1.21.1.2310"
Cron-Builder
Cron Builder object that can be used to build Cron expressions, describe them, and manipulate objects.
Feature Overview
- Build Cron Expression.
- Create Cron by Expression.
- Display Description of Cron expression or a section.
- Expression Chaining of Cron object and Sections (Seconds, Minutes, Hours, DayMonth, Months, DayWeek, Year).
- Set intervals or specific times on Time Sections (Seconds, Minutes, Hours).
- Set specific date sections (DayMonth, Months, DayWeek, Year).
Examples
Create a new CronBuilder Object.
Create Default Cron Object.
schedule = new CronBuilder();
Create Cron object with an existing expression.
var cron = new CronBuilder(expression);
Create Initial Cron object with Days.
var cron = new CronBuilder
{
{ CronDays.Thursday, CronDays.Saturday }
};
Create Initial Cron object with Months.
var cron = new CronBuilder
{
{ CronMonths.August, CronMonths.November }
};
Create Initial Cron object with Months and Day.
var cron = new CronBuilder
{
{ CronDays.Thursday, CronMonths.November }
};
Build Cron by Section.
Add to Cron with sections.
schedule.Add(time: CronTimeSections.Seconds, value: seconds, repeatEvery: true)
schedule.Add(CronTimeSections.Minutes, 4)
schedule.Add(CronTimeSections.Hours, 3, 5)
Add a Month Restriction to the Cron Expression.
schedule.Add(CronMonths.March)
Add a Day of the Week Restriction to the Cron Expression.
schedule.Add(CronDays.Wednesday)
Chain Cron and Sections.
schedule = new CronBuilder();
schedule
.Add(CronDays.Friday)
.Add(CronTimeSections.DayMonth, dayMonth)
.Add(CronTimeSections.Years, years, true)
.Seconds.Add(5);
Display Cron Description
var descCron = cron.Description;
var descSeconds = cron.Seconds.Description;
Remove all or parts of a Cron Expression.
Remove only one entry of 5 in Seconds.
cron.Remove(CronTimeSections.Seconds, 5);
Remove only one entry Range of Seconds.
cron.Remove(CronTimeSections.Seconds, 5, 6);
Reset / Remove All of the Day of the Week section.
cron.Reset(CronTimeSections.DayWeek);
Reset all sections to the defaults.
cron.ResetAll();
Updates
Version 1.20.11.2216
Minor Cleanup and Fixes / Update packages.
Version 1.1.11.17
Cron Object renamed to CronBuilder to simplify creation due to conflicting namespace.
Cron-Builder
Cron Builder object that can be used to build Cron expressions, describe them, and manipulate objects.
Feature Overview
- Build Cron Expression.
- Create Cron by Expression.
- Display Description of Cron expression or a section.
- Expression Chaining of Cron object and Sections (Seconds, Minutes, Hours, DayMonth, Months, DayWeek, Year).
- Set intervals or specific times on Time Sections (Seconds, Minutes, Hours).
- Set specific date sections (DayMonth, Months, DayWeek, Year).
Examples
Create a new CronBuilder Object.
Create Default Cron Object.
schedule = new CronBuilder();
Create Cron object with an existing expression.
var cron = new CronBuilder(expression);
Create Initial Cron object with Days.
var cron = new CronBuilder
{
{ CronDays.Thursday, CronDays.Saturday }
};
Create Initial Cron object with Months.
var cron = new CronBuilder
{
{ CronMonths.August, CronMonths.November }
};
Create Initial Cron object with Months and Day.
var cron = new CronBuilder
{
{ CronDays.Thursday, CronMonths.November }
};
Build Cron by Section.
Add to Cron with sections.
schedule.Add(time: CronTimeSections.Seconds, value: seconds, repeatEvery: true)
schedule.Add(CronTimeSections.Minutes, 4)
schedule.Add(CronTimeSections.Hours, 3, 5)
Add a Month Restriction to the Cron Expression.
schedule.Add(CronMonths.March)
Add a Day of the Week Restriction to the Cron Expression.
schedule.Add(CronDays.Wednesday)
Chain Cron and Sections.
schedule = new CronBuilder();
schedule
.Add(CronDays.Friday)
.Add(CronTimeSections.DayMonth, dayMonth)
.Add(CronTimeSections.Years, years, true)
.Seconds.Add(5);
Display Cron Description
var descCron = cron.Description;
var descSeconds = cron.Seconds.Description;
Remove all or parts of a Cron Expression.
Remove only one entry of 5 in Seconds.
cron.Remove(CronTimeSections.Seconds, 5);
Remove only one entry Range of Seconds.
cron.Remove(CronTimeSections.Seconds, 5, 6);
Reset / Remove All of the Day of the Week section.
cron.Reset(CronTimeSections.DayWeek);
Reset all sections to the defaults.
cron.ResetAll();
Updates
Version 1.20.11.2216
Minor Cleanup and Fixes / Update packages.
Version 1.1.11.17
Cron Object renamed to CronBuilder to simplify creation due to conflicting namespace.
Release Notes
1.1.11.17: Cron renamed to Cron Builder. Bug Fixes in Description property.
Dependencies
-
.NETStandard 2.0
- EnhancedEnum-StrongNamed (>= 1.21.1.2310)
- System.ComponentModel.Annotations (>= 5.0.0)
Used By
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version History
Version | Downloads | Last updated | |
---|---|---|---|
1.21.1.2310 | 60 | 1/23/2021 | |
1.20.11.2216 | 213 | 11/22/2020 | |
1.1.11.17 | 84 | 11/17/2020 | |
1.1.11.15 | 149 | 11/15/2020 | |
1.1.11.12 | 446 | 11/12/2020 | |
1.0.0.187 | 244 | 11/10/2020 |