Period Struct
A struct used to describe periods of time.
public readonly struct Period : System.IComparable<HAKOM.TSM.Net.Api.Time.Periods.Period>, System.IEquatable<HAKOM.TSM.Net.Api.Time.Periods.Period>Implements System.IComparable<Period>, System.IEquatable<Period>
Properties
Section titled “Properties”Period.From Property
Section titled “Period.From Property”Gets the System.DateTimeOffset representing the beginning of the period.
public System.DateTimeOffset From { get; }Property Value
Section titled “Property Value”Period.To Property
Section titled “Period.To Property”Gets the System.DateTimeOffset representing the end of the period.
public System.DateTimeOffset To { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Period.CompareTo(Period) Method
Section titled “Period.CompareTo(Period) Method”Compares this period to the given other by their duration and, if their duration is the same, by their from parameters.
public int CompareTo(HAKOM.TSM.Net.Api.Time.Periods.Period other);Parameters
Section titled “Parameters”other Period
The other Period used for the comparison.
Returns
Section titled “Returns”- A negative System.Int32, if this period is shorter (or starts earlier, if they’re equally long) than other
- 0, if both have the same duration and start date
- a positive System.Int32, if this period is longer (or starts later, if they’re equally long) than other
Period.Create(DateTimeOffset, DateTimeOffset) Method
Section titled “Period.Create(DateTimeOffset, DateTimeOffset) Method”Creates a new instance of Period with the given from and to.
public static HAKOM.TSM.Net.Api.Time.Periods.Period Create(System.DateTimeOffset from, System.DateTimeOffset to);Parameters
Section titled “Parameters”The System.DateTimeOffset representing the beginning of the new period.
The System.DateTimeOffset representing the end of the new period.
Returns
Section titled “Returns”Period
A new instance of Period.
Period.Default() Method
Section titled “Period.Default() Method”Creates a default instance of Period with default values for the from and to parameters. The default instance exists to ensure, that periods not created by the static Create method have a from parameter, which is before their to parameter.
public static HAKOM.TSM.Net.Api.Time.Periods.Period Default();Returns
Section titled “Returns”Period
The default instance of Period.
Period.Equals(Period) Method
Section titled “Period.Equals(Period) Method”Compares this period to the given other for equality.
public bool Equals(HAKOM.TSM.Net.Api.Time.Periods.Period other);Parameters
Section titled “Parameters”other Period
The other Period used for the comparison.
Returns
Section titled “Returns”System.Boolean
True, if the periods are equal in duration and start time, otherwise false.
Period.Equals(object) Method
Section titled “Period.Equals(object) Method”Compares this period to the given obj for equality.
public override bool Equals(object? obj);Parameters
Section titled “Parameters”obj System.Object
The other System.Object used for the comparison.
Returns
Section titled “Returns”System.Boolean
True, if the object is a period with equal duration and start time, otherwise false.
Period.GetHashCode() Method
Section titled “Period.GetHashCode() Method”Creates a hash for this period, using its from and to parameters.
public override int GetHashCode();Returns
Section titled “Returns”System.Int32
A hash code for this period.
Period.IsBounded(Period) Method
Section titled “Period.IsBounded(Period) Method”Checks if Period has bounds.
public static bool IsBounded(HAKOM.TSM.Net.Api.Time.Periods.Period period);Parameters
Section titled “Parameters”period Period
The Period to be checked.
Returns
Section titled “Returns”System.Boolean
true if either From or To is not respectively Min/MaxValue otherwise false
Period.ToPeriod((DateTimeOffset,DateTimeOffset)) Method
Section titled “Period.ToPeriod((DateTimeOffset,DateTimeOffset)) Method”public static HAKOM.TSM.Net.Api.Time.Periods.Period ToPeriod((System.DateTimeOffset,System.DateTimeOffset) range);Parameters
Section titled “Parameters”range <System.DateTimeOffset,System.DateTimeOffset>
Returns
Section titled “Returns”Period.ToString() Method
Section titled “Period.ToString() Method”Used to get a string representation of the period, using its from and to properties, separated by a comma.
public override string ToString();Returns
Section titled “Returns”System.String
A System.String representation of the period.
Period.TryCreate(DateTimeOffset, DateTimeOffset) Method
Section titled “Period.TryCreate(DateTimeOffset, DateTimeOffset) Method”Attempts to create a new instance of Period with the given from and to.
public static HAKOM.ErrorHandling.Core.Net.Api.Result<HAKOM.TSM.Net.Api.Time.Periods.Period> TryCreate(System.DateTimeOffset from, System.DateTimeOffset to);Parameters
Section titled “Parameters”The System.DateTimeOffset representing the beginning of the new period.
The System.DateTimeOffset representing the end of the new period.
Returns
Section titled “Returns”HAKOM.ErrorHandling.Core.Net.Api.Result<Period>
A Result<TValue> indicating if the period could successfully be created
Operators
Section titled “Operators”Period.operator ==(Period, Period) Operator
Section titled “Period.operator ==(Period, Period) Operator”Compares the given periods using the ‘==’ operator.
public static bool operator ==(HAKOM.TSM.Net.Api.Time.Periods.Period left, HAKOM.TSM.Net.Api.Time.Periods.Period right);Parameters
Section titled “Parameters”left Period
The Period on the left of the ‘==’.
right Period
The Period on the right of the ‘==’.
Returns
Section titled “Returns”System.Boolean
True, if the given periods are equal, otherwise false.
Period.operator >(Period, Period) Operator
Section titled “Period.operator >(Period, Period) Operator”Compares the left Period to the right Period by their duration and, if their duration is the same, by their from parameters using the ‘>’ operator.
public static bool operator >(HAKOM.TSM.Net.Api.Time.Periods.Period left, HAKOM.TSM.Net.Api.Time.Periods.Period right);Parameters
Section titled “Parameters”left Period
The Period on the left of the ‘>’.
right Period
The Period on the right of the ‘>’.
Returns
Section titled “Returns”System.Boolean
True, if the left Period is longer (or starts later, if they’re equally long)
than the right Period, otherwise false.
Period.operator >=(Period, Period) Operator
Section titled “Period.operator >=(Period, Period) Operator”Compares the left Period to the right Period by their duration and, if their duration is the same, by their from parameters using the ‘>=’ operator.
public static bool operator >=(HAKOM.TSM.Net.Api.Time.Periods.Period left, HAKOM.TSM.Net.Api.Time.Periods.Period right);Parameters
Section titled “Parameters”left Period
The Period on the left of the ‘>=’.
right Period
The Period on the right of the ‘>=’.
Returns
Section titled “Returns”System.Boolean
True, if the left Period is longer (or starts later, if they’re equally long)
than the right Period or both periods are equally long and start at the same time, otherwise false.
Period.implicit operator Period((DateTimeOffset,DateTimeOffset)) Operator
Section titled “Period.implicit operator Period((DateTimeOffset,DateTimeOffset)) Operator”public static HAKOM.TSM.Net.Api.Time.Periods.Period implicit operator HAKOM.TSM.Net.Api.Time.Periods.Period((System.DateTimeOffset,System.DateTimeOffset) range);Parameters
Section titled “Parameters”range <System.DateTimeOffset,System.DateTimeOffset>
Returns
Section titled “Returns”Period.operator !=(Period, Period) Operator
Section titled “Period.operator !=(Period, Period) Operator”Compares the given periods using the ‘!=’ operator.
public static bool operator !=(HAKOM.TSM.Net.Api.Time.Periods.Period left, HAKOM.TSM.Net.Api.Time.Periods.Period right);Parameters
Section titled “Parameters”left Period
The Period on the left of the ‘!=’.
right Period
The Period on the right of the ‘!=’.
Returns
Section titled “Returns”System.Boolean
True, if the given periods are not equal, otherwise false.
Period.operator <(Period, Period) Operator
Section titled “Period.operator <(Period, Period) Operator”Compares the left Period to the right Period by their duration and, if their duration is the same, by their from parameters using the ‘<’ operator.
public static bool operator <(HAKOM.TSM.Net.Api.Time.Periods.Period left, HAKOM.TSM.Net.Api.Time.Periods.Period right);Parameters
Section titled “Parameters”left Period
The Period on the left of the ‘<’.
right Period
The Period on the right of the ‘<’.
Returns
Section titled “Returns”System.Boolean
True, if the left Period is shorter (or starts earlier, if they’re equally long)
than the right Period, otherwise false.
Period.operator <=(Period, Period) Operator
Section titled “Period.operator <=(Period, Period) Operator”Compares the left Period to the right Period by their duration and, if their duration is the same, by their from parameters using the ‘<=’ operator.
public static bool operator <=(HAKOM.TSM.Net.Api.Time.Periods.Period left, HAKOM.TSM.Net.Api.Time.Periods.Period right);Parameters
Section titled “Parameters”left Period
The Period on the left of the ‘<=’.
right Period
The Period on the right of the ‘<=’.
Returns
Section titled “Returns”System.Boolean
True, if the left Period is shorter (or starts earlier, if they’re equally long)
than the right Period or both periods are equally long and start at the same time, otherwise false.