using DataLayer; using LibationUiBase.ProcessQueue; using System; using System.Collections.Generic; #nullable enable namespace LibationWinForms.ProcessQueue; internal class ProcessQueueViewModel : ProcessQueueViewModelBase { public event EventHandler? LogWritten; public List Items { get; } public ProcessQueueViewModel() : base(new List()) { Items = Queue.UnderlyingList as List ?? throw new ArgumentNullException(nameof(Queue.UnderlyingList)); } public override void WriteLine(string text) => Invoke(() => LogWritten?.Invoke(this, text.Trim())); protected override ProcessBookViewModelBase CreateNewProcessBook(LibraryBook libraryBook) => new ProcessBookViewModel(libraryBook, Logger); }