public override byte[] ToBytes()
{
List<byte> totalBuffer = new List<byte>();
RdpbcgrEncoder.EncodeStructure(totalBuffer, tpktHeader);
RdpbcgrEncoder.EncodeStructure(totalBuffer, x224Data);
if (disconnectProvider != null)
{
DomainMCSPDU mcsDPum = new DomainMCSPDU
(DomainMCSPDU.disconnectProviderUltimatum, disconnectProvider);
RdpbcgrEncoder.EncodeDomainMcsPdu(totalBuffer, mcsDPum);
}
byte[] encodedBytes = RdpbcgrUtility.ToBytes(totalBuffer);
// ToDo: Ugly dump message code here
// ETW Provider Dump Code
RdpbcgrUtility.ETWProviderDump(this.GetType().Name, encodedBytes);
return encodedBytes;
}