global event for projects running changed
This commit is contained in:
7
src/SharpIDE.Application/Features/Events/GlobalEvents.cs
Normal file
7
src/SharpIDE.Application/Features/Events/GlobalEvents.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace SharpIDE.Application.Features.Events;
|
||||
|
||||
public static class GlobalEvents
|
||||
{
|
||||
public static event Func<Task> ProjectsRunningChanged = () => Task.CompletedTask;
|
||||
public static void InvokeProjectsRunningChanged() => ProjectsRunningChanged?.Invoke();
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using Ardalis.GuardClauses;
|
||||
using AsyncReadProcess.Common;
|
||||
using AsyncReadProcess;
|
||||
using SharpIDE.Application.Features.Events;
|
||||
using SharpIDE.Application.Features.SolutionDiscovery.VsPersistence;
|
||||
|
||||
namespace SharpIDE.Application.Features.Run;
|
||||
@@ -39,8 +40,11 @@ public class RunService
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
project.Running = true;
|
||||
GlobalEvents.InvokeProjectsRunningChanged();
|
||||
await process.WaitForExitAsync();
|
||||
project.Running = false;
|
||||
GlobalEvents.InvokeProjectsRunningChanged();
|
||||
|
||||
Console.WriteLine("Project ran successfully.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user