private void OnDataReceived(object sender, DataReceivedEventArgs e) { var handler = DataReceived; if (handler != null) { DataReceived(this, e); } }
private void OnDataReceived(object sender, DataReceivedEventArgs e) { try { stepLabel.Text = e.DataAsString.Substring(0, e.DataAsString.IndexOf("\n")); ParseMessageToInt(e.DataAsString.Replace("\0", "")); } catch (Exception){} }