Struct ClockTime
- Namespace
- Glitch9
[Serializable]
public struct ClockTime : IComparable
- Implements
- Inherited Members
- Extension Methods
Constructors
ClockTime(ClockTime, bool)
public ClockTime(ClockTime clockTime, bool immutable = false)
Parameters
ClockTime(DateTime, bool)
public ClockTime(DateTime dateTime, bool immutable = false)
Parameters
ClockTime(int, bool)
public ClockTime(int time, bool immutable = false)
Parameters
ClockTime(int, int, bool)
public ClockTime(int hour, int minute, bool immutable = false)
Parameters
Fields
Immutable
public bool Immutable
Field Value
Value
public int Value
Field Value
Properties
Afternoon
public static ClockTime Afternoon { get; }
Property Value
Dawn
public static ClockTime Dawn { get; }
Property Value
Evening
public static ClockTime Evening { get; }
Property Value
Hour
public int Hour { readonly get; set; }
Property Value
Midnight
public static ClockTime Midnight { get; }
Property Value
Minute
public int Minute { readonly get; set; }
Property Value
Morning
public static ClockTime Morning { get; }
Property Value
Night
public static ClockTime Night { get; }
Property Value
Noon
public static ClockTime Noon { get; }
Property Value
Now
public static ClockTime Now { get; }
Property Value
TotalMinutes
public readonly int TotalMinutes { get; }
Property Value
Zero
public static ClockTime Zero { get; }
Property Value
Methods
AddHours(int)
public ClockTime AddHours(int hours)
Parameters
hours
int
Returns
AddMinutes(int)
public ClockTime AddMinutes(int minutes)
Parameters
minutes
int
Returns
CompareTo(object)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public readonly int CompareTo(object obj)
Parameters
obj
objectAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes obj
in the sort order.Zero This instance occurs in the same position in the sort order as obj
.Greater than zero This instance follows obj
in the sort order.
Exceptions
- ArgumentException
obj
is not the same type as this instance.
Equals(ClockTime)
public readonly bool Equals(ClockTime other)
Parameters
other
ClockTime
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override readonly int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToDateTime()
public readonly DateTime ToDateTime()
Returns
ToServerString()
public readonly string ToServerString()
Returns
ToString()
Returns the fully qualified type name of this instance.
public override readonly string ToString()
Returns
- string
The fully qualified type name.
ToString(string)
public readonly string ToString(string format)
Parameters
format
string
Returns
TryParse(string, out ClockTime)
public static bool TryParse(string time, out ClockTime result)
Parameters
Returns
Operators
operator +(ClockTime, TimeSpan)
public static ClockTime operator +(ClockTime a, TimeSpan b)
Parameters
Returns
operator ==(ClockTime, ClockTime)
public static bool operator ==(ClockTime a, ClockTime b)
Parameters
Returns
explicit operator DateTime(ClockTime)
public static explicit operator DateTime(ClockTime time)
Parameters
time
ClockTime
Returns
operator >(ClockTime, ClockTime)
public static bool operator >(ClockTime a, ClockTime b)
Parameters
Returns
operator >=(ClockTime, ClockTime)
public static bool operator >=(ClockTime a, ClockTime b)
Parameters
Returns
implicit operator int(ClockTime)
public static implicit operator int(ClockTime time)
Parameters
time
ClockTime
Returns
implicit operator ClockTime(DateTime)
public static implicit operator ClockTime(DateTime dateTime)
Parameters
dateTime
DateTime
Returns
implicit operator ClockTime(int)
public static implicit operator ClockTime(int time)
Parameters
time
int
Returns
operator !=(ClockTime, ClockTime)
public static bool operator !=(ClockTime a, ClockTime b)
Parameters
Returns
operator <(ClockTime, ClockTime)
public static bool operator <(ClockTime a, ClockTime b)
Parameters
Returns
operator <=(ClockTime, ClockTime)
public static bool operator <=(ClockTime a, ClockTime b)
Parameters
Returns
operator -(ClockTime, ClockTime)
public static TimeSpan operator -(ClockTime a, ClockTime b)