Beispiel #1
0
        /// <summary>
        /// 更新开始结束程序
        /// </summary>
        void BeginCloseProcess()
        {
            int percent = 1;

            if (!ListTool.IsNullOrEmpty(version.BeginCloseProcess))
            {
                foreach (var p in version.BeginCloseProcess)
                {
                    Thread.Sleep(R.cst.WAIT_TIME);
                    UIPbStatus((int)((double)(percent++) / version.BeginCloseProcess.Count() * 100));
                    if (!string.IsNullOrWhiteSpace(p))
                    {
                        ProcessTool.KillProcess(p);
                    }
                }
            }
            Step = 2;
        }
Beispiel #2
0
 public static void BeforeUpdate(VersionModel vm)
 {
     if (ListTool.HasElements(vm.BeforeUpdateKillProcess))
     {
         foreach (var p in vm.BeforeUpdateKillProcess)
         {
             ProcessTool.KillProcess(p);
         }
     }
     if (ListTool.HasElements(vm.BeforeUpdateStartProcess))
     {
         foreach (var p in vm.BeforeUpdateStartProcess)
         {
             string file = DirTool.IsDriver(p) ? p : DirTool.Combine(R.Paths.ProjectRoot, p);
             ProcessTool.StartProcess(file);
         }
     }
 }
Beispiel #3
0
 public static void AfterUpdate(List <string> killProcess, List <string> startProcess)
 {
     if (ListTool.HasElements(killProcess))
     {
         foreach (var p in killProcess)
         {
             ProcessTool.KillProcess(p);
         }
     }
     if (ListTool.HasElements(startProcess))
     {
         foreach (var p in startProcess)
         {
             string file = DirTool.IsDriver(p) ? p : DirTool.Combine(R.Paths.ProjectRoot, p);
             ProcessTool.StartProcess(file);
         }
     }
 }
Beispiel #4
0
 public static void KillProcess(Frisbee f)
 {
     if (!ListTool.IsNullOrEmpty(f.KillProcess))
     {
         foreach (var r in f.KillProcess)
         {
             if (!string.IsNullOrWhiteSpace(r))
             {
                 ProcessTool.KillProcess(r);
             }
         }
         R.Log.i("结束进程完成 共" + f.KillProcess.Count() + "项");
     }
     else
     {
         R.Log.i("结束进程列表为空");
     }
 }