/// <summary> /// Encode this structure into byte array. /// </summary> /// <returns>The byte array of the structure.</returns> public override byte[] ToBytes() { List<byte> totalBuffer = new List<byte>(); RdpbcgrEncoder.EncodeStructure(totalBuffer, tpktHeader); RdpbcgrEncoder.EncodeStructure(totalBuffer, x224Data); ChannelJoinRequest joinRequest = new ChannelJoinRequest(new UserId(userChannelId), new ChannelId(mcsChannelId)); DomainMCSPDU mcsDomain = new DomainMCSPDU(DomainMCSPDU.channelJoinRequest, joinRequest); RdpbcgrEncoder.EncodeDomainMcsPdu(totalBuffer, mcsDomain); return RdpbcgrUtility.ToBytes(totalBuffer); }