Example #1
0
            public void Dispose()
            {
                if (Disposed)
                {
                    return;
                }

                try
                {
                    if (!(RunProcess?.HasExited ?? true))
                    {
                        RunProcess?.Kill();
                    }

                    if (File.Exists(FilePath))
                    {
                        File.Delete(FilePath);
                    }

                    Console.WriteLine("Deleted temp file {0}", FilePath);
                }
                catch (Exception exc)
                {
                    Console.WriteLine(exc.Message);
                }

                Disposed = true;
            }
Example #2
0
 public void Exit()
 {
     if (RunProcess != null && RunProcess.HasExited == false)
     {
         try
         {
             RunProcess.Kill();
             RunProcess.Close();
         }
         catch
         {
         }
     }
     SetListViewInfo("未运行");
     IsRun      = false;
     RunProcess = null;
 }