mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 00:56:19 +02:00
Reorganize project structure
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using RemSox.Kernel.Processes;
|
||||
using RemSox.Kernel.Processing;
|
||||
|
||||
namespace RemSox.Kernel.UI.CLI.Commands;
|
||||
|
||||
public class StopRemoteDesktopCommand : ICommand
|
||||
{
|
||||
public string Name => "rdp-stop";
|
||||
public string Description => "Stops the remote desktop server";
|
||||
|
||||
public async Task ExecuteAsync(string? arguments, Action<string> printLine)
|
||||
{
|
||||
if (!ProcessManager.IsProcessRunning<RemoteDesktopProcess>())
|
||||
{
|
||||
printLine("Remote desktop server is not running.");
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (RemoteDesktopProcess process in ProcessManager.GetProcessesOfType<RemoteDesktopProcess>())
|
||||
{
|
||||
await ProcessManager.StopProcessAndWaitAsync(process.Id);
|
||||
}
|
||||
|
||||
printLine("Remote desktop server stopped.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user