Show / Hide Table of Contents

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.

Inheritance
object
TimeSpanWrapper
CronTimeSpanWrapper
Implements
ITimeSpanProvider
Inherited Members
TimeSpanWrapper.IntRawValue
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Cognite.Extractor.Common
Assembly: Cognite.Common.dll
Syntax
public class CronTimeSpanWrapper : TimeSpanWrapper, ITimeSpanProvider

Constructors

| Edit this page View Source

CronTimeSpanWrapper(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 Source

IsDynamic

Whether the interval is dynamic or not, e.g. cron expression

Declaration
public override bool IsDynamic { get; }
Property Value
Type Description
bool
Overrides
TimeSpanWrapper.IsDynamic
| Edit this page View Source

RawValue

Raw string value of option.

Declaration
public override string RawValue { get; set; }
Property Value
Type Description
string
Overrides
TimeSpanWrapper.RawValue
| Edit this page View Source

Value

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
Overrides
TimeSpanWrapper.Value

Implements

ITimeSpanProvider

Extension Methods

DataModelUtils.GetOrCreateResourcesAsync<T, T2>(T2, IEnumerable<InstanceIdentifier>, Func<IEnumerable<InstanceIdentifier>, IEnumerable<SourcedNodeWrite<T>>>, Func<IEnumerable<SourcedNodeWrite<T>>, SanitationMode, (IEnumerable<SourcedNodeWrite<T>>, IEnumerable<CogniteError<SourcedNodeWrite<T>>>)>, int, int, RetryMode, SanitationMode, CancellationToken)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX