private void OnStdOutRead(string text) { string[] putText = { text }; try { Invoke(PutStdOutText, putText); } catch (ObjectDisposedException) { manager.StopMonitoringProcessOutput(); txtConsole.Enabled = true; } catch (Exception ex) { ErrorResult err = new ErrorResult(); err.Message = ex.Message; StdErrResults.Add(err); DisplayErrors(); StdErrResults.Clear(); } }
private void OnPutStdErrText(string text) { var error = new ErrorResult(); if (text.StartsWith("Error:")) { error.Message = text; } else if (text.IndexOf(":") > -1) { var msgPattern = @"\s:\s(.+)"; if (Regex.IsMatch(text, msgPattern)) { error.File = text.Substring(0, text.IndexOf(":")); var sub = text.Substring(0, text.IndexOf(" : ")); error.Line = text.Substring(text.IndexOf(":") + 1, text.IndexOf(" : ") - sub.IndexOf(':')); error.Message = Regex.Matches(text, msgPattern)[0].Groups[1].Value; } } else error.Message = text; StdErrResults.Add(error); DisplayErrors(); }
private void OnStdErrRead(string text) { try { Invoke(PutStdErrText, text); } catch (ObjectDisposedException) { manager.StopMonitoringProcessOutput(); DisplayErrors(); } catch (Exception ex) { ErrorResult err = new ErrorResult(); err.Message = ex.Message; StdErrResults.Add(err); DisplayErrors(); StdErrResults.Clear(); } }
private void CheckBuildConfigPath(string path) { try { if (File.Exists(path + "\\build.tsc")) { config = Json.Decode<List<BuildConfig>>(File.ReadAllText(path + "\\build.tsc")); } } catch (Exception ex) { var err = new ErrorResult(); err.Message = ex.Message; StdErrResults.Add(err); DisplayErrors(); } }