The TS_UD_CS_MONITOR_EX packet describes extended attributes of the client-side display monitor layout defined by the Client Monitor Data block (section 2.2.1.3.6). This packet is an Extended Client Data Block and MUST NOT be sent to a server which does not advertise support for Extended Client Data Blocks by using the EXTENDED_CLIENT_DATA_SUPPORTED flag (0x00000001) as described in section 2.2.1.2.1.
        /// <summary>
        /// Parse TS_UD_CS_MONITOR_EX
        /// (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_UD_CS_MONITOR_EX</returns>
        private TS_UD_CS_MONITOR_EX ParseTsUdCsMonitorEX(byte[] data, ref int currentIndex)
        {
            TS_UD_CS_MONITOR_EX monitorEx = new TS_UD_CS_MONITOR_EX();
            monitorEx.header.type = (TS_UD_HEADER_type_Values)ParseUInt16(data, ref currentIndex, false);
            monitorEx.header.length = ParseUInt16(data, ref currentIndex, false);
            monitorEx.flags = ParseUInt32(data, ref currentIndex, false);
            monitorEx.monitorAttributeSize = ParseUInt32(data, ref currentIndex, false);
            monitorEx.monitorCount = ParseUInt32(data, ref currentIndex, false);

            List<TS_MONITOR_ATTRIBUTES> attributeList = new List<TS_MONITOR_ATTRIBUTES>();
            while (attributeList.Count < monitorEx.monitorCount)
            {
                TS_MONITOR_ATTRIBUTES attribute = new TS_MONITOR_ATTRIBUTES();
                attribute.physicalWidth = ParseUInt32(data, ref currentIndex, false);
                attribute.physicalHeight = ParseUInt32(data, ref currentIndex, false);
                attribute.orientation = (TS_MONITOR_ATTRIBUTES_orientation_values)ParseUInt32(data, ref currentIndex, false);
                attribute.desktopScaleFactor = ParseUInt32(data, ref currentIndex, false);
                attribute.deviceScaleFactor = ParseUInt32(data, ref currentIndex, false);

                attributeList.Add(attribute);
            }
            monitorEx.monitorAttributesArray = attributeList.ToArray();

            return monitorEx;
        }