private void ProcessOutput(string data) { switch (data[0]) { case '*': // out of band data. if (currentCommand != null) { currentCommand.OutOfBandDataReceived(data); } if (DebugMode) { console.WriteLine("[Async Record] " + data); } ProcessAsynRecord(data); break; case '=': // notification record if (DebugMode) { console.WriteLine("[Notification] " + data); } break; case '^': //this is for a response. if (DebugMode) { console.WriteLine("[Response] " + data + Environment.NewLine); } if (currentCommand != null) { response += data; if (responseReceived.CurrentCount == 0) { responseReceived.Release(); } } else if (DebugMode) { console.WriteLine("Current Command NULL"); } break; case '&': if (data == "&\"Quit (expect signal SIGINT when the program is resumed)\\n\"") { if (InternalStopped != null) { InternalStopped(this, null); } } break; } }