Command status

This commit is contained in:
2022-02-02 18:59:37 +01:00
parent d795ddcd11
commit f40c84a123
21 changed files with 331 additions and 70 deletions

View File

@@ -0,0 +1,43 @@
using System.Linq;
using System.Collections.Generic;
using System;
using FileTime.Core.Timeline;
namespace FileTime.Avalonia.ViewModels
{
public class ParallelCommandsViewModel : IDisposable
{
private bool _disposed;
public IReadOnlyCollection<ParallelCommandViewModel> ParallelCommands { get; }
public ushort Id { get; }
public ParallelCommandsViewModel(ReadOnlyParallelCommands parallelCommands)
{
ParallelCommands = parallelCommands.Commands.Select(c => new ParallelCommandViewModel(c)).ToList().AsReadOnly();
Id = parallelCommands.Id;
}
~ParallelCommandsViewModel()
{
Dispose(false);
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
private void Dispose(bool disposing)
{
if (!_disposed && disposing)
{
foreach(var commandVm in ParallelCommands)
{
commandVm.Dispose();
}
}
_disposed = true;
}
}
}