private AnsiLog Init_AnsiLog([NotNull] ConEmuStartInfo startinfo) { var ansilog = new AnsiLog(_dirTempWorkingFolder); _lifetime.Add(() => ansilog.Dispose()); if (startinfo.AnsiStreamChunkReceivedEventSink != null) { ansilog.AnsiStreamChunkReceived += startinfo.AnsiStreamChunkReceivedEventSink; } // Do the pumping periodically (TODO: take this to async?.. but would like to keep the final evt on the home thread, unless we go to tasks) // TODO: if ConEmu writes to a pipe, we might be getting events when more data comes to the pipe rather than poll it by timer var timer = new Timer() { Interval = (int)TimeSpan.FromSeconds(.1).TotalMilliseconds, Enabled = true }; timer.Tick += delegate { ansilog.PumpStream(); }; _lifetime.Add(() => timer.Dispose()); return(ansilog); }
private AnsiLog Init_AnsiLog([NotNull] ConEmuStartInfo startinfo) { var ansilog = new AnsiLog(_dirTempWorkingFolder); _lifetime.Add(() => ansilog.Dispose()); if(startinfo.AnsiStreamChunkReceivedEventSink != null) ansilog.AnsiStreamChunkReceived += startinfo.AnsiStreamChunkReceivedEventSink; // Do the pumping periodically (TODO: take this to async?.. but would like to keep the final evt on the home thread, unless we go to tasks) // TODO: if ConEmu writes to a pipe, we might be getting events when more data comes to the pipe rather than poll it by timer var timer = new Timer() {Interval = (int)TimeSpan.FromSeconds(.1).TotalMilliseconds, Enabled = true}; timer.Tick += delegate { ansilog.PumpStream(); }; _lifetime.Add(() => timer.Dispose()); return ansilog; }