Show / Hide Table of Contents

Class TimeSpanWrapper

Utility for containing a string converted to timespan in config objects. To use: public string MyIntervalValue { get; } = new TimeSpanWrapper(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
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 TimeSpanWrapper : ITimeSpanProvider

Constructors

| Edit this page View Source

TimeSpanWrapper(bool, string, string)

Create a new timespan wrapper. The wrapper is intended to be a singleton, i.e. it is not recreated if the config is modified.

Declaration
public TimeSpanWrapper(bool allowZero, string defaultUnit, string defaultValue)
Parameters
Type Name Description
bool allowZero
string defaultUnit
string defaultValue

Properties

| Edit this page View Source

IntRawValue

Internal raw value.

Declaration
protected string IntRawValue { get; set; }
Property Value
Type Description
string
| Edit this page View Source

IsDynamic

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

Declaration
public virtual bool IsDynamic { get; }
Property Value
Type Description
bool
| Edit this page View Source

RawValue

Raw string value of option.

Declaration
public virtual string RawValue { get; set; }
Property Value
Type Description
string
| Edit this page View Source

Value

Converted value as TimeSpan.

Declaration
public virtual TimeSpan Value { get; }
Property Value
Type Description
TimeSpan

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