public static void RunBatch(string[] files, string arg, string javaH, string cwd, ref MessageScreenScrollable mockConsole) { if (files == null) { return; } int numberOfFiles = files.Length; JavaHBatchEntry[] batches = new JavaHBatchEntry[numberOfFiles]; Thread[] threads = new Thread[numberOfFiles]; JavaHBatchIncrementer incrementer = new JavaHBatchIncrementer(numberOfFiles, ref mockConsole); for (int i = 0; i < numberOfFiles; i++) { FileInfo file = new FileInfo(files[i]); batches[i] = new JavaHBatchEntry(file, arg, javaH, cwd, ref mockConsole, ref threads[i], ref incrementer); batches[i].Execute(); } while (!AllThreadsDone(threads)) { if (mockConsole != null) { mockConsole.AppendText(Environment.NewLine + "..."); } Thread.Sleep(1000); } }
public static void RunBatch(string[] files, string[] args, string javaH, string[] cwd, ref MessageScreenScrollable mockConsole) { if (files == null) { return; } if (args == null) { return; } if (cwd == null) { return; } if (files.Length != args.Length || files.Length != cwd.Length) { return; } int numberOfFiles = files.Length; JavaHBatchEntry[] batches = new JavaHBatchEntry[numberOfFiles]; Thread[] threads = new Thread[numberOfFiles]; JavaHBatchIncrementer incrementer = new JavaHBatchIncrementer(numberOfFiles, ref mockConsole); for (int i = 0; i < numberOfFiles; i++) { FileInfo file = new FileInfo(files[i]); batches[i] = new JavaHBatchEntry(file, args[i], javaH, cwd[i], ref mockConsole, ref threads[i], ref incrementer); batches[i].Execute(); } while (!AllThreadsDone(threads)) { Thread.Sleep(1000); } }
public JavaHBatchEntry(FileInfo _file, string _args, string _javaHExec, string _workingDirectory, ref MessageScreenScrollable _mockConsole, ref Thread _runOnThread, ref JavaHBatchIncrementer _incrementer) { ClassFile = _file; Args = _args; JavaHExec = _javaHExec; WorkingDirectory = _workingDirectory; MockConsole = _mockConsole; RunOnThread = _runOnThread; Incrementer = _incrementer; }