/// <summary> /// Convert the given Msg to the current view Setting as a String /// </summary> /// <returns></returns> public List <MsgHighlightStruct> getMsgHighlightetListWithCurrentViewSettings(MsgData msg) { List <MsgHighlightStruct> _list = new List <MsgHighlightStruct>(); MsgHighlightStruct returnStruct; // Only change the view to the Sended and Recived Data if (msg.type == MsgData.messageType.recived || msg.type == MsgData.messageType.send) { // Return the Msg with the Current View Configuration switch (viewSettings.dataPresentation) { case 1: returnStruct.msgAsString = Converty.msgDataToHexData(msg); returnStruct.msgStringType = 0; _list.Add(returnStruct); break; case 2: returnStruct.msgAsString = Converty.msgDataToDecData(msg); returnStruct.msgStringType = 0; _list.Add(returnStruct); break; case 3: returnStruct.msgAsString = Converty.msgDataToBinData(msg); returnStruct.msgStringType = 0; _list.Add(returnStruct); break; // Default View String with ASCII Chars default: //returnMsg = Converty.msgDataToSpecialAsciiString(msg.value); _list = Converty.getMsgDataAsStringWithHighlightetView(msg.value); break; } } else { returnStruct.msgAsString = Converty.msgDataToAsciiChar(msg); returnStruct.msgStringType = 0; _list.Add(returnStruct); } return(_list); }
/// <summary> /// Convert the given Msg to the current view Setting as a String /// </summary> /// <returns></returns> public string getMsgWithCurrentViewSettings(MsgData msg) { string returnMsg; // Only change the view to the Sended and Recived Data if (msg.type == MsgData.messageType.recived || msg.type == MsgData.messageType.send) { // Return the Msg with the Current View Configuration switch (viewSettings.dataPresentation) { case 1: returnMsg = Converty.msgDataToHexData(msg); break; case 2: returnMsg = Converty.msgDataToDecData(msg); break; case 3: returnMsg = Converty.msgDataToBinData(msg); break; // Default View String with ASCII Chars default: returnMsg = Converty.msgDataToSpecialAsciiString(msg.value); break; } } else { returnMsg = Converty.msgDataToAsciiChar(msg); } return(returnMsg); }