Show / Hide Table of Contents

Struct TimePeriod

Implements
System.IEquatable<TimePeriod>
System.IComparable<TimePeriod>
Inherited Members
System.ValueType.GetHashCode()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: TimeLib
Assembly: TimeLib.dll
Syntax
public struct TimePeriod : IEquatable<TimePeriod>, IComparable<TimePeriod>

Constructors

| Improve this Doc View Source

TimePeriod(Int64)

Declaration
public TimePeriod(long hour)
Parameters
Type Name Description
System.Int64 hour
| Improve this Doc View Source

TimePeriod(Int64, Int64)

Declaration
public TimePeriod(long hour, long minute)
Parameters
Type Name Description
System.Int64 hour
System.Int64 minute
| Improve this Doc View Source

TimePeriod(Int64, Int64, Int64)

Declaration
public TimePeriod(long hour, long minute, long second)
Parameters
Type Name Description
System.Int64 hour
System.Int64 minute
System.Int64 second
| Improve this Doc View Source

TimePeriod(String)

Create time period from string.

Declaration
public TimePeriod(string period)
Parameters
Type Name Description
System.String period

Format H:mm:ss.

Properties

| Improve this Doc View Source

Hours

Hours.

Declaration
public long Hours { get; }
Property Value
Type Description
System.Int64
| Improve this Doc View Source

Minutes

Minutes.

Declaration
public long Minutes { get; }
Property Value
Type Description
System.Int64
| Improve this Doc View Source

Seconds

Seconds.

Declaration
public long Seconds { get; }
Property Value
Type Description
System.Int64

Methods

| Improve this Doc View Source

CompareTo(TimePeriod)

Compare one TimePeriod instance to another.

Declaration
public int CompareTo(TimePeriod other)
Parameters
Type Name Description
TimePeriod other

Structure to compare.

Returns
Type Description
System.Int32

1 if base TimePeriod is greater, 0 if base TimePeriod is equal to other and -1 if TimePeriod is smaller than other.

| Improve this Doc View Source

Equals(Object)

Compare structure to other object.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj
Returns
Type Description
System.Boolean
Overrides
System.ValueType.Equals(System.Object)
| Improve this Doc View Source

Equals(TimePeriod)

Compare TimePeriod to other TimePeriod structure.

Declaration
public bool Equals(TimePeriod other)
Parameters
Type Name Description
TimePeriod other
Returns
Type Description
System.Boolean
| Improve this Doc View Source

ToString()

Convert structure into string.

Declaration
public override string ToString()
Returns
Type Description
System.String

Returns formatted TimePeriod HH:mm:ss.

Overrides
System.ValueType.ToString()

Operators

| Improve this Doc View Source

Addition(TimePeriod, TimePeriod)

Add one time period instance to another.

Declaration
public static TimePeriod operator +(TimePeriod timePeriod1, TimePeriod timePeriod2)
Parameters
Type Name Description
TimePeriod timePeriod1
TimePeriod timePeriod2
Returns
Type Description
TimePeriod

New instance of time period.

| Improve this Doc View Source

Equality(TimePeriod, TimePeriod)

Check if timePeriod1 is equal to timePeriod2.

Declaration
public static bool operator ==(TimePeriod timePeriod1, TimePeriod timePeriod2)
Parameters
Type Name Description
TimePeriod timePeriod1
TimePeriod timePeriod2
Returns
Type Description
System.Boolean

True if both instances are equal.

| Improve this Doc View Source

GreaterThan(TimePeriod, TimePeriod)

Check if timePeriod1 is longer than timePeriod2.

Declaration
public static bool operator>(TimePeriod timePeriod1, TimePeriod timePeriod2)
Parameters
Type Name Description
TimePeriod timePeriod1
TimePeriod timePeriod2
Returns
Type Description
System.Boolean

True if timePeriod1 is longer than timePeriod2.

| Improve this Doc View Source

GreaterThanOrEqual(TimePeriod, TimePeriod)

Check if timePeriod1 is longer or equal to timePeriod2.

Declaration
public static bool operator >=(TimePeriod timePeriod1, TimePeriod timePeriod2)
Parameters
Type Name Description
TimePeriod timePeriod1
TimePeriod timePeriod2
Returns
Type Description
System.Boolean

True if timePeriod1 is longer or equal to timePeriod2.

| Improve this Doc View Source

Inequality(TimePeriod, TimePeriod)

Check if timePeriod1 is not equal to timePeriod2.

Declaration
public static bool operator !=(TimePeriod timePeriod1, TimePeriod timePeriod2)
Parameters
Type Name Description
TimePeriod timePeriod1
TimePeriod timePeriod2
Returns
Type Description
System.Boolean

True if both instances are not equal.

| Improve this Doc View Source

LessThan(TimePeriod, TimePeriod)

Check if timePeriod1 is shorter than timePeriod2.

Declaration
public static bool operator <(TimePeriod timePeriod1, TimePeriod timePeriod2)
Parameters
Type Name Description
TimePeriod timePeriod1
TimePeriod timePeriod2
Returns
Type Description
System.Boolean

True if timePeriod1 is shorter than timePeriod2.

| Improve this Doc View Source

LessThanOrEqual(TimePeriod, TimePeriod)

Check if timePeriod1 is shorter or equal to timePeriod2.

Declaration
public static bool operator <=(TimePeriod timePeriod1, TimePeriod timePeriod2)
Parameters
Type Name Description
TimePeriod timePeriod1
TimePeriod timePeriod2
Returns
Type Description
System.Boolean

True if timePeriod1 is shorter or equal to timePeriod2.

| Improve this Doc View Source

Subtraction(TimePeriod, TimePeriod)

Substract timePeriod2 instance from timePeriod1.

Declaration
public static TimePeriod operator -(TimePeriod timePeriod1, TimePeriod timePeriod2)
Parameters
Type Name Description
TimePeriod timePeriod1
TimePeriod timePeriod2
Returns
Type Description
TimePeriod

New instance of time period.

Implements

System.IEquatable<T>
System.IComparable<T>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX