Timeline view animation
This commit is contained in:
@@ -16,6 +16,7 @@ public class ParallelCommands : IDisposable
|
||||
public IObservable<IChangeSet<CommandTimeState>> Commands { get; }
|
||||
|
||||
public BindedCollection<CommandTimeState> CommandsCollection { get; }
|
||||
public int CommandCount => _commands.Count;
|
||||
|
||||
public PointInTime? Result { get; private set; }
|
||||
|
||||
|
||||
@@ -115,18 +115,28 @@ public class CommandScheduler : ICommandScheduler
|
||||
|
||||
private async void ExecutorOnCommandFinished(object? sender, ICommand command)
|
||||
{
|
||||
var firstCommandBlock = _commandsToRun
|
||||
.Items
|
||||
.FirstOrDefault();
|
||||
var state = firstCommandBlock
|
||||
?.CommandsCollection
|
||||
.Collection
|
||||
?.FirstOrDefault(c => c.Command == command);
|
||||
await RunWithLockAsync(async () =>
|
||||
{
|
||||
var firstCommandBlock = _commandsToRun
|
||||
.Items
|
||||
.FirstOrDefault();
|
||||
var state = firstCommandBlock
|
||||
?.CommandsCollection
|
||||
.Collection
|
||||
?.FirstOrDefault(c => c.Command == command);
|
||||
|
||||
if (state is null) return;
|
||||
if (state is null) return;
|
||||
|
||||
state.ExecutionState = ExecutionState.Finished;
|
||||
if (firstCommandBlock is not null) await firstCommandBlock.RemoveCommand(command);
|
||||
state.ExecutionState = ExecutionState.Finished;
|
||||
if (firstCommandBlock is not null)
|
||||
{
|
||||
await firstCommandBlock.RemoveCommand(command);
|
||||
if (firstCommandBlock.CommandCount == 0)
|
||||
{
|
||||
_commandsToRun.Remove(firstCommandBlock);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private async Task RefreshCommands()
|
||||
|
||||
Reference in New Issue
Block a user