project stopped

This commit is contained in:
Matt Parker
2025-08-25 19:14:55 +10:00
parent 8d759812a2
commit 117e306a5d
3 changed files with 17 additions and 4 deletions

View File

@@ -103,6 +103,8 @@ public class RunService
project.RunningCancellationTokenSource = null;
project.Running = false;
GlobalEvents.InvokeProjectsRunningChanged();
GlobalEvents.InvokeProjectStoppedRunning(project);
project.InvokeProjectStoppedRunning();
Console.WriteLine("Project finished running");
}
@@ -119,7 +121,6 @@ public class RunService
if (project.RunningCancellationTokenSource is null) throw new InvalidOperationException($"Project {project.Name} does not have a running cancellation token source.");
await project.RunningCancellationTokenSource.CancelAsync().ConfigureAwait(false);
GlobalEvents.InvokeProjectStoppedRunning(project);
}
private string GetRunArguments(SharpIdeProjectModel project)

View File

@@ -99,6 +99,10 @@ public class SharpIdeProjectModel : ISharpIdeNode, IExpandableSharpIdeNode, IChi
public string BlazorDevServerVersion => MsBuildEvaluationProject.Items.Single(s => s.ItemType is "PackageReference" && s.EvaluatedInclude is "Microsoft.AspNetCore.Components.WebAssembly.DevServer").GetMetadataValue("Version");
public bool OpenInRunPanel { get; set; }
public Channel<byte[]>? RunningOutputChannel { get; set; }
public event Func<Task> ProjectStartedRunning = () => Task.CompletedTask;
public void InvokeProjectStartedRunning() => ProjectStartedRunning?.Invoke();
public void InvokeProjectStartedRunning() => ProjectStartedRunning.Invoke();
public event Func<Task> ProjectStoppedRunning = () => Task.CompletedTask;
public void InvokeProjectStoppedRunning() => ProjectStoppedRunning.Invoke();
}