Class Station
- Namespace
- RadioExt_Helper.models
- Assembly
- RadioExt-Helper.dll
Represents a single radio station. Contains all information related to the station.
public sealed class Station : INotifyPropertyChanged, ICloneable, IEquatable<Station>
- Inheritance
-
Station
- Implements
- Inherited Members
Properties
CustomIcon
The custom icon associated with this station.
[JsonIgnore]
public CustomIcon CustomIcon { get; set; }
Property Value
Icons
Represents a list of icons associated with a radio station.
A station can only have one active icon at a time.
[JsonProperty("icons")]
public List<TrackableObject<WolvenIcon>> Icons { get; set; }
Property Value
- List<TrackableObject<WolvenIcon>>
MetaData
The metadata associated with this station.
[JsonIgnore]
public MetaData MetaData { get; set; }
Property Value
Songs
Represents a list of songs associated with a radio station.
[JsonProperty("songs")]
public List<Song> Songs { get; set; }
Property Value
StreamInfo
The stream info associated with this station.
[JsonIgnore]
public StreamInfo StreamInfo { get; set; }
Property Value
Methods
AddCustomData(string?, object)
Add custom data to the station. If the key already exists, the value will be updated.
public void AddCustomData(string? key, object value)
Parameters
key
string- The key of the data to add.
value
object- The data contents to add with the specified key.
AddIcon(TrackableObject<WolvenIcon>)
Add an icon to this station if it is not already associated. A station can have any number of icons but only one can be active at a time.
public bool AddIcon(TrackableObject<WolvenIcon> icon)
Parameters
icon
TrackableObject<WolvenIcon>- The Icon to add to the station.
Returns
- bool
true
if the icon was added successfully;false
otherwise.
AddIcon(TrackableObject<WolvenIcon>, bool)
Add an icon to this station if it is not already associated. A station can have any number of icons but only one can be active at a time.
Optionally, make the icon active.
public bool AddIcon(TrackableObject<WolvenIcon> icon, bool makeActive)
Parameters
icon
TrackableObject<WolvenIcon>- The Icon to add to the station.
makeActive
bool- Indicates whether to make the newly added icon active for the station.
Returns
- bool
true
if the icon was added successfully;false
otherwise.
CheckActiveIconValid()
Ensures the active icon (if any) is valid for the station. A valid active icon has been imported and has its archive file present.
This should be the case when either the icon is generated from a PNG or imported from a .zip file containing a station.
public bool CheckActiveIconValid()
Returns
- bool
true
if the active icon is valid.false
otherwise or there were no active icons.
Exceptions
- InvalidOperationException
- Occurs when there is more than 1 active icon in the station.
Clone()
Creates a new object that is a copy of the current instance.
public object Clone()
Returns
- object
- A new object that is a copy of this instance.
ContainsCustomData(string)
Get a value indicating if the station's custom data contains the specified key.
public bool ContainsCustomData(string key)
Parameters
key
string- The key of the data to check existence of.
Returns
- bool
true
if the key was present in the custom data;false
otherwise.
Equals(Station?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Station? other)
Parameters
other
Station- An object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
object- The object to compare with the current object.
Returns
GetActiveIcon()
Get the active Icon for the station.
public TrackableObject<WolvenIcon>? GetActiveIcon()
Returns
- TrackableObject<WolvenIcon>
- The active Icon or
null
if no active icons or there was more than 1 active icon.
Exceptions
- InvalidOperationException
- Occurs when there is more than 1 active icon in the station.
GetCustomData(string)
Get the custom data specified by the key in the station.
public object GetCustomData(string key)
Parameters
key
string- The key of the data to get.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
- A hash code for the current object.
GetStatus()
Get a value indicating if this station is active in game or not.
public bool GetStatus()
Returns
RemoveAllIcons()
Remove all icons from the station.
public void RemoveAllIcons()
RemoveCustomData(string?)
Remove the custom data associated with the specified key.
public void RemoveCustomData(string? key)
Parameters
key
string- The key of the data to remove.
RemoveIcon(TrackableObject<WolvenIcon>)
Remove an icon from the station, if it exists.
public bool RemoveIcon(TrackableObject<WolvenIcon> icon)
Parameters
icon
TrackableObject<WolvenIcon>- The Icon to remove.
Returns
- bool
true
if the icon was removed successfully;false
otherwise.
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
- A string that represents the current object.
Events
PropertyChanged
Occurs when a property value changes.
public event PropertyChangedEventHandler? PropertyChanged