private static string Execute(string processName, IEnumerable<string> commands, Func<IObservable<string>, IDisposable> outputFeedSubscribeAction, Action<IObserver<string>> processAttachAction) { return CommandPromptRunner.Run(processName, commands.Concat("exit").ToObservable(), IsConsole(), outputFeedSubscribeAction, processAttachAction); }
public void StartCmdPromptProcess(string processName) { var subject = new Subject <string>(); m_observer = subject; var syncContext = SynchronizationContext.Current; Task.Factory.StartNew(() => { CommandPromptRunner.Run ( processName, subject, outputFeedSubscribeAction: o => o.Buffer(TimeSpan.FromMilliseconds(50), 10).ObserveOn(syncContext) .Subscribe(Observer.Create <IList <string> >(x => richTextBox1.AppendText(string.Join(string.Empty, x)))) ); }); }