Class ImageCollectionPluginBase
An implementation of IImageCollection 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 ImageCollectionPluginBase : IModelPlugin, IImageCollection, IImageCollectionBase, ICollectionBase, IAppModel, IMerged<ICoreImageCollection>, IEquatable<ICoreImageCollection>, IMerged, IDelegatable<IImageCollection>
Constructors
| Improve this Doc View SourceImageCollectionPluginBase(ModelPluginMetadata, IImageCollection)
Creates a new instance of ImageCollectionPluginBase.
Declaration
protected ImageCollectionPluginBase(ModelPluginMetadata registration, IImageCollection inner)
Parameters
Type | Name | Description |
---|---|---|
ModelPluginMetadata | registration | Metadata about the plugin which was provided during registration. |
IImageCollection | 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 IImageCollection Inner { get; set; }
Property Value
Type | Description |
---|---|
IImageCollection |
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<ICoreImageCollection> Sources { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<ICoreImageCollection> |
TotalImageCount
The total number of images in the collection.
Declaration
public virtual int TotalImageCount { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Improve this Doc View SourceAddImageAsync(IImage, int, CancellationToken)
Adds a new image to the collection.
Declaration
public virtual Task AddImageAsync(IImage image, int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IImage | image | The image to add. |
int | index | the position to insert the image 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(ICoreImageCollection?)
Declaration
public virtual bool Equals(ICoreImageCollection? other)
Parameters
Type | Name | Description |
---|---|---|
ICoreImageCollection | other |
Returns
Type | Description |
---|---|
bool |
GetImagesAsync(int, int, CancellationToken)
Gets a requested number of IImageBases starting at the given offset.
Declaration
public virtual IAsyncEnumerable<IImage> GetImagesAsync(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<IImage> | The requested range of items. |
IsAddImageAvailableAsync(int, CancellationToken)
Checks if adding a IImageBase to the collection at at the given index
is supported.
Declaration
public virtual Task<bool> IsAddImageAvailableAsync(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 IImageBase can be added. |
IsRemoveImageAvailableAsync(int, CancellationToken)
Checks if removing a IImageBase to the collection at at the given index
is supported.
Declaration
public virtual Task<bool> IsRemoveImageAvailableAsync(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 IImageBase can be removed. |
RemoveImageAsync(int, CancellationToken)
Removes the image from the collection on the backend.
Declaration
public virtual Task RemoveImageAsync(int index, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the image to remove. |
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 SourceImagesChanged
Fires when the items are changed.
Declaration
public virtual event CollectionChangedEventHandler<IImage>? ImagesChanged
Event Type
Type | Description |
---|---|
CollectionChangedEventHandler<IImage> |
ImagesCountChanged
Fires when the merged number of images in the collection changes.
Declaration
public virtual event EventHandler<int>? ImagesCountChanged
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 |