/// <summary> /// Parse TS_FONT_LIST_PDU /// (parser index is updated according to parsed length) /// </summary> /// <param name="data">data to be parsed</param> /// <param name="currentIndex">current parser index</param> /// <returns>TS_FONT_LIST_PDU</returns> private TS_FONT_LIST_PDU ParseTsFontListPdu(byte[] data, ref int currentIndex) { TS_FONT_LIST_PDU pdu = new TS_FONT_LIST_PDU(); pdu.shareDataHeader = ParseTsShareDataHeader(data, ref currentIndex); pdu.numberFonts = ParseUInt16(data, ref currentIndex, false); pdu.totalNumFonts = ParseUInt16(data, ref currentIndex, false); pdu.listFlags = ParseUInt16(data, ref currentIndex, false); pdu.entrySize = ParseUInt16(data, ref currentIndex, false); return pdu; }
/// <summary> /// Encode controlPduData field. /// </summary> /// <param name="fontListPduData">The data to be encoded.</param> /// <returns>The encoded data.</returns> private static byte[] EncodeFontListData(TS_FONT_LIST_PDU fontListPduData) { List<byte> dataBuffer = new List<byte>(); if (fontListPduData != null) { RdpbcgrEncoder.EncodeStructure(dataBuffer, fontListPduData.shareDataHeader); RdpbcgrEncoder.EncodeStructure(dataBuffer, fontListPduData.numberFonts); RdpbcgrEncoder.EncodeStructure(dataBuffer, fontListPduData.totalNumFonts); RdpbcgrEncoder.EncodeStructure(dataBuffer, fontListPduData.listFlags); RdpbcgrEncoder.EncodeStructure(dataBuffer, fontListPduData.entrySize); } return dataBuffer.ToArray(); }