// Copyright (c) Arlo Godfrey. All Rights Reserved.
// Licensed under the GNU Lesser General Public License, Version 3.0 with additional terms.
// See the LICENSE, LICENSE.LESSER and LICENSE.ADDITIONAL files in the project root for more information.
using System;
using System.Threading;
using System.Threading.Tasks;
namespace StrixMusic.Sdk.BaseModels
{
///
/// A common interface for all collections that return genres.
///
public interface IGenreCollectionBase : ICollectionBase, IAsyncDisposable
{
///
/// The total number of genres in this collection.
///
int TotalGenreCount { get; }
///
/// Removes a genre from the collection.
///
/// the position remove the genre from.
/// A cancellation token that may be used to cancel the ongoing task.
/// A representing the asynchronous operation.
Task RemoveGenreAsync(int index, CancellationToken cancellationToken = default);
///
/// Checks if adding a genre to the collection at at the given is supported.
///
/// A representing the asynchronous operation. If value is true, a new item can be added to the collection.
Task IsAddGenreAvailableAsync(int index, CancellationToken cancellationToken = default);
///
/// Checks if removing a genre to the collection at at the given is supported.
///
/// A representing the asynchronous operation. If value is true, the item can be removed from the collection..
Task IsRemoveGenreAvailableAsync(int index, CancellationToken cancellationToken = default);
///
/// Fires when the merged number of genres in the collection changes.
///
event EventHandler? GenresCountChanged;
}
}