private void Start() { _process.Start(); int count = 0; while (_isRunning) { using (var reader = _process.StandardOutput) { var files = Directory.GetFiles($@"{AppDomain.CurrentDomain.BaseDirectory}script\output"); while (!reader.EndOfStream) { ConsolePrint?.Invoke(reader.ReadLine(), null); } if (count != files.Length) { count = files.Length; EpochResult?.Invoke(this, null); } } Thread.Sleep(TimeSpan.FromMinutes(1)); } }