Table of Contents

Struct ReleaseDate

Namespace
Playnite.SDK.Models
Assembly
Playnite.SDK.dll

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

year int
month int

ReleaseDate(int, int, int)

Creates new instance of ReleaseDate.

public ReleaseDate(int year, int month, int day)

Parameters

year int
month int
day int

ReleaseDate(SerializationInfo, StreamingContext)

Creates new instance of ReleaseDate.

public ReleaseDate(SerializationInfo info, StreamingContext context)

Parameters

info SerializationInfo
context StreamingContext

Fields

Date

Gets DateTime representation of release date.

public readonly DateTime Date

Field Value

DateTime

Empty

Gets empty representation of release date.

public static readonly ReleaseDate Empty

Field Value

ReleaseDate

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

int

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 ReleaseDate

An 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 as other. Greater than zero This instance follows other 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 object

An 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.

Deserialize(string)

Deserialize string to release date.

public static ReleaseDate Deserialize(string stringDate)

Parameters

stringDate string

Returns

ReleaseDate

Equals(ReleaseDate)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ReleaseDate other)

Parameters

other ReleaseDate

An 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 object

The 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 SerializationInfo

The SerializationInfo to populate with data.

context StreamingContext

The 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

string

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 string
date ReleaseDate

Returns

bool

Operators

operator ==(ReleaseDate, ReleaseDate)

public static bool operator ==(ReleaseDate obj1, ReleaseDate obj2)

Parameters

obj1 ReleaseDate
obj2 ReleaseDate

Returns

bool

operator !=(ReleaseDate, ReleaseDate)

public static bool operator !=(ReleaseDate obj1, ReleaseDate obj2)

Parameters

obj1 ReleaseDate
obj2 ReleaseDate

Returns

bool