示例#1
0
 /// <summary>
 /// NurseryType: Operation
 /// 子进程退出时调用
 /// </summary>
 /// <param name="pathName"></param>
 /// <param name="processName"></param>
 public static void OnProcessStopped(string pathName, string processName)
 {
     NurseryToNoform.SetNurseryItemCheckState(pathName, CheckState.Unchecked);
     NurseryManager.Send(new OperationStruct
     {
         type        = OperationType.Stop,
         code        = OperationCode.OK,
         pathName    = pathName,
         processName = processName
     });
 }
示例#2
0
        public static void AddProcess(string pathName)
        {
            bool ac      = ProcessManager.Add(pathName);
            bool success = NurseryToNoform.AddNurseryItem(pathName);

            NurseryManager.Send(new OperationStruct
            {
                type     = OperationType.Add,
                code     = ac && success ? OperationCode.OK : OperationCode.Failed,
                pathName = pathName,
            });
        }
示例#3
0
        /// <summary>
        /// NurseryType: Operation
        /// 删除进程
        /// </summary>
        /// <param name="pathName"></param>
        /// <param name="processName"></param>
        public static void RemoveProcess(string pathName)
        {
            ProcessManager.Remove(pathName);
            bool success = NurseryToNoform.RemoveNurseryItem(pathName);

            NurseryManager.Send(new OperationStruct
            {
                type     = OperationType.Remove,
                code     = success ? OperationCode.OK : OperationCode.Failed,
                pathName = pathName
            });
        }
示例#4
0
        /// <summary>
        /// NurseryType: Operation
        /// </summary>
        /// <param name="pathName"></param>
        /// <param name="args"></param>
        public static void StartProcess(string pathName, string args = "")
        {
            string processName = ProcessManager.Start(pathName, args);
            bool   uni         = NurseryToNoform.UpdateNurseryItem(pathName, processName);
            bool   scics       = NurseryToNoform.SetNurseryItemCheckState(pathName, CheckState.Checked);

            NurseryManager.Send(new OperationStruct
            {
                type        = OperationType.Start,
                code        = processName != null && uni && scics ? OperationCode.OK : OperationCode.Failed,
                pathName    = pathName,
                processName = processName
            });
        }