Class GenreCollectionPluginBase
An implementation of IGenreCollection which delegates all member access to the Inner implementation, unless the member is overridden in a derived class which changes the behavior.
Implements
Inherited Members
Namespace: StrixMusic.Sdk.Plugins.Model
Assembly: StrixMusic.Sdk.dll
Syntax
public class GenreCollectionPluginBase : IModelPlugin, IGenreCollection, IGenreCollectionBase, ICollectionBase, IAppModel, IMerged<ICoreGenreCollection>, IEquatable<ICoreGenreCollection>, IMerged, IDelegatable<IGenreCollection>
Constructors
| Improve this Doc View SourceGenreCollectionPluginBase(ModelPluginMetadata, IGenreCollection)
Creates a new instance of GenreCollectionPluginBase.
Declaration
protected GenreCollectionPluginBase(ModelPluginMetadata registration, IGenreCollection inner)
Parameters
Type | Name | Description |
---|---|---|
ModelPluginMetadata | registration | Metadata about the plugin which was provided during registration. |
IGenreCollection | inner | The implementation which all member access is delegated to, unless the member is overridden in a derived class which changes the behavior. |
Properties
| Improve this Doc View SourceInner
Declaration
public IGenreCollection Inner { get; set; }
Property Value
Type | Description |
---|---|
IGenreCollection |
Metadata
The plugin metadata that was provided during registration.
Declaration
public ModelPluginMetadata Metadata { get; }
Property Value
Type | Description |
---|---|
ModelPluginMetadata |
Sources
The sources that make up this merged item.
Declaration
public IReadOnlyList<ICoreGenreCollection> Sources { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<ICoreGenreCollection> |
TotalGenreCount
The total number of genres in this collection.
Declaration
public virtual int TotalGenreCount { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Improve this Doc View SourceAddGenreAsync(IGenre, int, CancellationToken)
Adds a new genre to the collection.
Declaration
public virtual Task AddGenreAsync(IGenre gene, int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IGenre | gene | |
int | index | the position to insert the genre at. |
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
Equals(ICoreGenreCollection?)
Declaration
public virtual bool Equals(ICoreGenreCollection? other)
Parameters
Type | Name | Description |
---|---|---|
ICoreGenreCollection | other |
Returns
Type | Description |
---|---|
bool |
GetGenresAsync(int, int, CancellationToken)
Gets a requested number of IGenreBases starting at the given offset.
Declaration
public virtual IAsyncEnumerable<IGenre> GetGenresAsync(int limit, int offset, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | limit | The max number of items to return. |
int | offset | Get items starting at this index. |
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<IGenre> | The requested range of items. |
IsAddGenreAvailableAsync(int, CancellationToken)
Checks if adding a genre to the collection at at the given index
is supported.
Declaration
public virtual Task<bool> IsAddGenreAvailableAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | A Task representing the asynchronous operation. If value is true, a new item can be added to the collection. |
IsRemoveGenreAvailableAsync(int, CancellationToken)
Checks if removing a genre to the collection at at the given index
is supported.
Declaration
public virtual Task<bool> IsRemoveGenreAvailableAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<bool> | A Task representing the asynchronous operation. If value is true, the item can be removed from the collection.. |
RemoveGenreAsync(int, CancellationToken)
Removes a genre from the collection.
Declaration
public virtual Task RemoveGenreAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | the position remove the genre from. |
CancellationToken | cancellationToken | A cancellation token that may be used to cancel the ongoing task. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
Events
| Improve this Doc View SourceGenresChanged
Fires when the genres are changed.
Declaration
public virtual event CollectionChangedEventHandler<IGenre>? GenresChanged
Event Type
Type | Description |
---|---|
CollectionChangedEventHandler<IGenre> |
GenresCountChanged
Fires when the merged number of genres in the collection changes.
Declaration
public virtual event EventHandler<int>? GenresCountChanged
Event Type
Type | Description |
---|---|
EventHandler<int> |
SourcesChanged
Raised when any of the sources have changed.
Declaration
public event EventHandler? SourcesChanged
Event Type
Type | Description |
---|---|
EventHandler |