/// <summary> /// Decode to a RECT. /// </summary> private void DecodeRect(PduMarshaler marshaler, out RECT rct) { rct = new RECT(); rct.left = marshaler.ReadInt32(); rct.top = marshaler.ReadInt32(); rct.right = marshaler.ReadInt32(); rct.bottom = marshaler.ReadInt32(); }
/// <summary> /// Decode this PDU to the PduMarshaler. /// </summary> /// <param name="marshaler">This is used to Decode the fields of this PDU.</param> /// <returns></returns> public bool Decode(PduMarshaler marshaler) { try { Flags = (MonitorLayout_FlagValues)marshaler.ReadUInt32(); Left = marshaler.ReadInt32(); Top = marshaler.ReadInt32(); Width = marshaler.ReadUInt32(); Height = marshaler.ReadUInt32(); PhysicalWidth = marshaler.ReadUInt32(); PhysicalHeight = marshaler.ReadUInt32(); Orientation = (MonitorLayout_OrientationValues)marshaler.ReadUInt32(); DesktopScaleFactor = marshaler.ReadUInt32(); DeviceScaleFactor = marshaler.ReadUInt32(); return true; } catch { marshaler.Reset(); throw new PDUDecodeException(this.GetType(), marshaler.ReadToEnd()); } }