Esempio n. 1
0
        public IEnumerable <SimplifiedProcess> GetProc()
        {
            Process[]           allLocalProcesses = Process.GetProcesses();
            SimplifiedProcess[] toReturn          = new SimplifiedProcess[allLocalProcesses.Length];
            int counter = 0;

            foreach (Process process in allLocalProcesses)
            {
                toReturn[counter] = new SimplifiedProcess(process);
                counter++;
            }
            return(toReturn);
        }
        public ISimplifiedProcess CreateProcess(string jarPath, string userFolder, string projectFolder)
        {
            var p = new SimplifiedProcess()
            {
                StartInfo = new ProcessStartInfo
                {
                    FileName               = "java",
                    Arguments              = $"-jar {jarPath} {userFolder} {projectFolder}",
                    UseShellExecute        = false,
                    RedirectStandardOutput = true
                }
            };

            p.Start();
            return(p);
        }