Class CronTimeSpanWrapper
Utility for containing a string converted to timespan in config objects. Also supports cron expresions.
To use: public string MyIntervalValue { get; } = new CronTimeSpanWrapper(false, "s", "0"); public string MyInterval { get => MyIntervalValue.RawValue; set => MyIntervalValue.RawValue = value; }
Access MyIntervalValue.Value in your code, and MyInterval is the config option.
Implements
Inherited Members
Namespace: Cognite.Extractor.Common
Assembly: Cognite.Common.dll
Syntax
public class CronTimeSpanWrapper : TimeSpanWrapper, ITimeSpanProvider
Constructors
| Edit this page View SourceCronTimeSpanWrapper(bool, bool, string, string)
Create a new cron expression timespan wrapper. The wrapper is intended to be a singleton, i.e. it is not recreated if the config is modified.
Declaration
public CronTimeSpanWrapper(bool includeSeconds, bool allowZero, string defaultUnit, string defaultValue)
Parameters
Type | Name | Description |
---|---|---|
bool | includeSeconds | |
bool | allowZero | |
string | defaultUnit | |
string | defaultValue |
Properties
| Edit this page View SourceIsDynamic
Whether the interval is dynamic or not, e.g. cron expression
Declaration
public override bool IsDynamic { get; }
Property Value
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceRawValue
Raw string value of option.
Declaration
public override string RawValue { get; set; }
Property Value
Type | Description |
---|---|
string |
Overrides
| Edit this page View SourceValue
If the raw value is a cron expression this is the time to the next occurence. If not, it is the converted time span as for TimeSpanWrapper
Declaration
public override TimeSpan Value { get; }
Property Value
Type | Description |
---|---|
TimeSpan |