Struct ReleaseDate
Represents game release date.
[Serializable]
public struct ReleaseDate : IComparable, IComparable<ReleaseDate>, IEquatable<ReleaseDate>, ISerializable
- Implements
- Inherited Members
Constructors
ReleaseDate(DateTime)
Creates new instance of ReleaseDate.
public ReleaseDate(DateTime dateTime)
Parameters
dateTime
DateTime
ReleaseDate(int)
Creates new instance of ReleaseDate.
public ReleaseDate(int year)
Parameters
year
int
ReleaseDate(int, int)
Creates new instance of ReleaseDate.
public ReleaseDate(int year, int month)
Parameters
ReleaseDate(int, int, int)
Creates new instance of ReleaseDate.
public ReleaseDate(int year, int month, int day)
Parameters
ReleaseDate(SerializationInfo, StreamingContext)
Creates new instance of ReleaseDate.
public ReleaseDate(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfocontext
StreamingContext
Fields
Date
Gets DateTime representation of release date.
public readonly DateTime Date
Field Value
Empty
Gets empty representation of release date.
public static readonly ReleaseDate Empty
Field Value
Properties
Day
Gets release day.
public int? Day { get; }
Property Value
- int?
Month
Gets release month.
public int? Month { get; }
Property Value
- int?
Year
Gets release year.
public int Year { get; }
Property Value
Methods
CompareTo(ReleaseDate)
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 int CompareTo(ReleaseDate other)
Parameters
other
ReleaseDateAn 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
other
in the sort order. Zero This instance occurs in the same position in the sort order asother
. Greater than zero This instance followsother
in the sort order.
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 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 asobj
. Greater than zero This instance followsobj
in the sort order.
Exceptions
- ArgumentException
obj
is not the same type as this instance.
Deserialize(string)
Deserialize string to release date.
public static ReleaseDate Deserialize(string stringDate)
Parameters
stringDate
string
Returns
Equals(ReleaseDate)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ReleaseDate other)
Parameters
other
ReleaseDateAn object to compare with this object.
Returns
- bool
true if the current object is equal to the
other
parameter; otherwise, false.
Equals(object)
Indicates whether this instance and a specified object are equal.
public override 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 int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
GetObjectData(SerializationInfo, StreamingContext)
Populates a SerializationInfo with the data needed to serialize the target object.
public void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
info
SerializationInfoThe SerializationInfo to populate with data.
context
StreamingContextThe destination (see StreamingContext) for this serialization.
Exceptions
- SecurityException
The caller does not have the required permission.
Serialize()
Gets release date serialized to a string.
public string Serialize()
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
TryDeserialize(string, out ReleaseDate)
Try to deserialize string to a release date.
public static bool TryDeserialize(string stringDate, out ReleaseDate date)
Parameters
stringDate
stringdate
ReleaseDate
Returns
Operators
operator ==(ReleaseDate, ReleaseDate)
public static bool operator ==(ReleaseDate obj1, ReleaseDate obj2)
Parameters
obj1
ReleaseDateobj2
ReleaseDate
Returns
operator !=(ReleaseDate, ReleaseDate)
public static bool operator !=(ReleaseDate obj1, ReleaseDate obj2)
Parameters
obj1
ReleaseDateobj2
ReleaseDate