MediaListOrBoolean Struct
The (MediaList or boolean) union (https://drafts.csswg.org/mediaqueries-5/#typedefdef-custommediaquery).
public readonly struct MediaListOrBoolean : IEquatable<MediaListOrBoolean>- Implements
Properties
| Name | Description |
|---|---|
| BooleanValue | Gets the boolean when the value is a boolean, otherwise null. |
| MediaList | Gets the media query list when the value is a media query list, otherwise null. |
| Value | Gets the value: a MediaList or a Boolean. |
BooleanValue
CSSRules.csMediaList
CSSRules.csGets the media query list when the value is a media query list, otherwise null.
public MediaList? MediaList { get; }Property value
Value
CSSRules.csMethods
| Name | Description |
|---|---|
| Equals(MediaListOrBoolean) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| FromBoolean(bool) | Creates a union value from a boolean. |
| FromMediaList(MediaList) | Creates a union value from a media query list. |
| GetHashCode() | Returns the hash code for this instance. |
Equals overloads
Equals(MediaListOrBoolean)
CSSRules.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(MediaListOrBoolean other)Parameters
otherMediaListOrBoolean- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
CSSRules.csFromBoolean(bool)
CSSRules.csCreates a union value from a boolean.
public static MediaListOrBoolean FromBoolean(bool value)FromMediaList(MediaList)
CSSRules.csCreates a union value from a media query list.
public static MediaListOrBoolean FromMediaList(MediaList value)GetHashCode()
CSSRules.csOperators
| Name | Description |
|---|---|
| operator ==(MediaListOrBoolean, MediaListOrBoolean) | Returns whether the two values hold the same media query list or the same boolean. |
| implicit operator MediaListOrBoolean(MediaList) | Creates a union value from a media query list. |
| implicit operator MediaListOrBoolean(bool) | Creates a union value from a boolean. |
| operator !=(MediaListOrBoolean, MediaListOrBoolean) | Returns whether the two values hold different values. |
operator ==(MediaListOrBoolean, MediaListOrBoolean)
CSSRules.csReturns whether the two values hold the same media query list or the same boolean.
public static bool operator ==(MediaListOrBoolean left, MediaListOrBoolean right)op_Implicit overloads
implicit operator MediaListOrBoolean(MediaList)
CSSRules.csCreates a union value from a media query list.
public static implicit operator MediaListOrBoolean(MediaList value)implicit operator MediaListOrBoolean(bool)
CSSRules.csCreates a union value from a boolean.
public static implicit operator MediaListOrBoolean(bool value)operator !=(MediaListOrBoolean, MediaListOrBoolean)
CSSRules.csReturns whether the two values hold different values.
public static bool operator !=(MediaListOrBoolean left, MediaListOrBoolean right)