public static bool TryParse(string msg, out TL1OutputMessage outputmessage) { outputmessage = null; try { outputmessage = TL1ResponseMessage.Parse(msg); return(true); } catch { return(false); } }
public static TL1OutputMessage Parse(string msg) { TL1OutputMessage output; if (TL1AcknowledgmentMessage.TryParse(msg, out output)) { } else if (TL1ResponseMessage.TryParse(msg, out output)) { } else if (TL1AutonomousMessage.TryParse(msg, out output)) { } else { throw new Exception(); } return(output); }