ToString() public method

public ToString ( ) : string
return string
 private string PduToXml(GXByteBuffer value, bool omitDeclaration, bool omitNameSpace)
 {
     if (value == null || value.Size == 0)
     {
         throw new ArgumentNullException("value");
     }
     GXDLMSTranslatorStructure xml = new GXDLMSTranslatorStructure(OutputType, Hex, ShowStringAsHex, tags);
     GXDLMSSettings settings = new GXDLMSSettings(true);
     GXReplyData data = new GXReplyData();
     byte cmd = value.GetUInt8();
     switch (cmd)
     {
         case (byte)Command.Aarq:
             value.Position = 0;
             settings = new GXDLMSSettings(true);
             GXAPDU.ParsePDU(settings, settings.Cipher, value, xml);
             break;
         case 0x81://Ua
             value.Position = 0;
             GetUa(value, xml);
             break;
         case (byte)Command.Aare:
             value.Position = 0;
             settings = new GXDLMSSettings(false);
             GXAPDU.ParsePDU(settings, settings.Cipher, value, xml);
             break;
         case (byte)Command.GetRequest:
             GXDLMSLNCommandHandler.HandleGetRequest(settings, null, value, null, xml);
             break;
         case (byte)Command.SetRequest:
             GXDLMSLNCommandHandler.HandleSetRequest(settings, null, value, null, xml);
             break;
         case (byte)Command.ReadRequest:
             GXDLMSSNCommandHandler.HandleReadRequest(settings, null, value, null, xml);
             break;
         case (byte)Command.MethodRequest:
             GXDLMSLNCommandHandler.HandleMethodRequest(settings, null, value, null, null, xml);
             break;
         case (byte)Command.WriteRequest:
             GXDLMSSNCommandHandler.HandleWriteRequest(settings, null, value, null, xml);
             break;
         case (byte)Command.AccessRequest:
             GXDLMSLNCommandHandler.HandleAccessRequest(settings, null, value, null, xml);
             break;
         case (byte)Command.DataNotification:
             data.Xml = xml;
             data.Data = value;
             value.Position = 0;
             GXDLMS.GetPdu(settings, data);
             break;
         case (byte)Command.ReadResponse:
         case (byte)Command.WriteResponse:
         case (byte)Command.GetResponse:
         case (byte)Command.SetResponse:
         case (byte)Command.MethodResponse:
         case (byte)Command.AccessResponse:
             data.Xml = xml;
             data.Data = value;
             value.Position = 0;
             GXDLMS.GetPdu(settings, data);
             break;
         case (byte)Command.ReleaseRequest:
         case (byte)Command.ReleaseResponse:
             xml.AppendStartTag((Command)cmd);
             //Len.
             if (value.GetUInt8() != 0)
             {
                 //BerType
                 value.GetUInt8();
                 //Len.
                 value.GetUInt8();
                 xml.AppendLine(TranslatorTags.Reason, "Value", ((ReleaseRequestReason)value.GetUInt8()).ToString());
             }
             xml.AppendEndTag((Command)cmd);
             break;
         case (byte)Command.GloReadRequest:
         case (byte)Command.GloWriteRequest:
         case (byte)Command.GloGetRequest:
         case (byte)Command.GloSetRequest:
         case (byte)Command.GloReadResponse:
         case (byte)Command.GloWriteResponse:
         case (byte)Command.GloGetResponse:
         case (byte)Command.GloSetResponse:
         case (byte)Command.GloMethodRequest:
         case (byte)Command.GloMethodResponse:
             int cnt = GXCommon.GetObjectCount(value);
             xml.AppendLine(cmd, "Value", GXCommon.ToHex(value.Data, false, value.Position, value.Size - value.Position));
             break;
         case (byte)Command.ConfirmedServiceError:
             data.Xml = xml;
             data.Data = value;
             GXDLMS.HandleConfirmedServiceError(data);
             break;
         default:
             xml.AppendLine("<Data=\"" + GXCommon.ToHex(value.Data, false, value.Position, value.Size - value.Position) + "\" />");
             break;
     }
     if (OutputType == TranslatorOutputType.StandardXml)
     {
         StringBuilder sb = new StringBuilder();
         if (!omitDeclaration)
         {
             sb.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
         }
         if (!omitNameSpace)
         {
             if (cmd != (byte)Command.Aare && cmd != (byte)Command.Aarq)
             {
                 sb.AppendLine(
                     "<x:xDLMS-APDU xmlns:x=\"http://www.dlms.com/COSEMpdu\">");
             }
             else
             {
                 sb.AppendLine(
                     "<x:aCSE-APDU xmlns:x=\"http://www.dlms.com/COSEMpdu\">");
             }
         }
         sb.Append(xml.ToString());
         if (!omitNameSpace)
         {
             if (cmd != (byte)Command.Aare && cmd != (byte)Command.Aarq)
             {
                 sb.AppendLine("</x:xDLMS-APDU>");
             }
             else
             {
                 sb.AppendLine("</x:aCSE-APDU>");
             }
         }
         return sb.ToString();
     }
     return xml.ToString();
 }