Class UrlCollectionPluginBase
An implementation of IUrlCollection 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 UrlCollectionPluginBase : IModelPlugin, IUrlCollection, IUrlCollectionBase, ICollectionBase, IAppModel, IMerged<ICoreUrlCollection>, IEquatable<ICoreUrlCollection>, IMerged, IDelegatable<IUrlCollection>
Constructors
| Improve this Doc View SourceUrlCollectionPluginBase(ModelPluginMetadata, IUrlCollection)
Creates a new instance of UrlCollectionPluginBase.
Declaration
protected UrlCollectionPluginBase(ModelPluginMetadata registration, IUrlCollection inner)
Parameters
Type | Name | Description |
---|---|---|
ModelPluginMetadata | registration | Metadata about the plugin which was provided during registration. |
IUrlCollection | 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 IUrlCollection Inner { get; set; }
Property Value
Type | Description |
---|---|
IUrlCollection |
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<ICoreUrlCollection> Sources { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<ICoreUrlCollection> |
TotalUrlCount
The total number of urls in this collection.
Declaration
public virtual int TotalUrlCount { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Improve this Doc View SourceAddUrlAsync(IUrl, int, CancellationToken)
Adds a new url to the collection.
Declaration
public virtual Task AddUrlAsync(IUrl url, int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IUrl | url | The url to insert. |
int | index | the position to insert the url 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(ICoreUrlCollection?)
Declaration
public virtual bool Equals(ICoreUrlCollection? other)
Parameters
Type | Name | Description |
---|---|---|
ICoreUrlCollection | other |
Returns
Type | Description |
---|---|
bool |
GetUrlsAsync(int, int, CancellationToken)
Gets a requested number of IUrlBases starting at the given offset.
Declaration
public virtual IAsyncEnumerable<IUrl> GetUrlsAsync(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<IUrl> | The requested range of items. |
IsAddUrlAvailableAsync(int, CancellationToken)
Checks if adding a url to the collection at at the given index
is supported.
Declaration
public virtual Task<bool> IsAddUrlAvailableAsync(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. |
IsRemoveUrlAvailableAsync(int, CancellationToken)
Checks if removing a url to the collection at at the given index
is supported.
Declaration
public virtual Task<bool> IsRemoveUrlAvailableAsync(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.. |
RemoveUrlAsync(int, CancellationToken)
Removes a url from the collection.
Declaration
public virtual Task RemoveUrlAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | the position remove the url 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 SourceSourcesChanged
Raised when any of the sources have changed.
Declaration
public event EventHandler? SourcesChanged
Event Type
Type | Description |
---|---|
EventHandler |
UrlsChanged
Fires when the urls are changed.
Declaration
public virtual event CollectionChangedEventHandler<IUrl>? UrlsChanged
Event Type
Type | Description |
---|---|
CollectionChangedEventHandler<IUrl> |
UrlsCountChanged
Fires when the merged number of urls in the collection changes.
Declaration
public virtual event EventHandler<int>? UrlsCountChanged
Event Type
Type | Description |
---|---|
EventHandler<int> |