From 3f51f7f6350731e5224844f44112f57f5de99a2e Mon Sep 17 00:00:00 2001
From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com>
Date: Fri, 12 Nov 2021 00:00:28 +0800
Subject: [PATCH] Add WindowsJobAPI
---
Netch/Controllers/Guard.cs | 1 +
Netch/Global.cs | 3 +++
Netch/Netch.csproj | 1 +
3 files changed, 5 insertions(+)
diff --git a/Netch/Controllers/Guard.cs b/Netch/Controllers/Guard.cs
index ae465b0d..09e79796 100644
--- a/Netch/Controllers/Guard.cs
+++ b/Netch/Controllers/Guard.cs
@@ -70,6 +70,7 @@ namespace Netch.Controllers
Instance.StartInfo.Arguments = argument;
Instance.Start();
+ Global.Job.AddProcess(Instance);
if (priority != ProcessPriorityClass.Normal)
Instance.PriorityClass = priority;
diff --git a/Netch/Global.cs b/Netch/Global.cs
index 817b5fa7..230cbb4a 100644
--- a/Netch/Global.cs
+++ b/Netch/Global.cs
@@ -7,6 +7,7 @@ using System.Windows.Forms;
using Netch.Forms;
using Netch.Models;
using Netch.Models.Modes;
+using WindowsJobAPI;
namespace Netch
{
@@ -22,6 +23,8 @@ namespace Netch
///
public static Setting Settings = new();
+ public static readonly JobObject Job = new();
+
///
/// 用于存储模式
///
diff --git a/Netch/Netch.csproj b/Netch/Netch.csproj
index a6c233c1..f443085b 100644
--- a/Netch/Netch.csproj
+++ b/Netch/Netch.csproj
@@ -53,6 +53,7 @@
+