PaletteListDataSource.cs 1.0 KB

123456789101112131415161718192021222324252627
  1. using PixiEditor.Extensions.CommonApi.Async;
  2. using PixiEditor.Extensions.CommonApi.Palettes.Parsers;
  3. namespace PixiEditor.Extensions.CommonApi.Palettes;
  4. public abstract class PaletteListDataSource
  5. {
  6. public string Name { get; set; }
  7. public PaletteListDataSource(string name)
  8. {
  9. Name = name;
  10. AvailableParsers = new List<PaletteFileParser>();
  11. }
  12. public virtual void Initialize() { }
  13. /// <summary>
  14. /// Fetches palettes from the provider.
  15. /// </summary>
  16. /// <param name="startIndex">Starting fetch index. Palettes before said index won't be fetched.</param>
  17. /// <param name="items">Max amount of palettes to fetch.</param>
  18. /// <param name="filtering">Filtering settings for fetching.</param>
  19. /// <returns>A List of palettes. Null if fetch wasn't successful.</returns>
  20. public abstract AsyncCall<List<IPalette>> FetchPaletteList(int startIndex, int items, FilteringSettings filtering);
  21. public List<PaletteFileParser> AvailableParsers { get; set; }
  22. }