Exemplo n.º 1
0
            public static PrinterNotifyInfo.Data Deserialize(IntPtr beginning)
            {
                var ret = new PrinterNotifyInfo.Data();

                ret.Type     = (ushort)Marshal.ReadInt16(Offset(beginning, "Type"));
                ret.Field    = (ushort)Marshal.ReadInt16(Offset(beginning, "Field"));
                ret.Reserved = (uint)Marshal.ReadInt32(Offset(beginning, "Reserved"));
                ret.ID       = (uint)Marshal.ReadInt32(Offset(beginning, "ID"));

                ret.IntegerData0 = (uint)Marshal.ReadInt32(IntegerDataOffset(beginning, "IntegerData0"));
                ret.IntegerData1 = (uint)Marshal.ReadInt32(IntegerDataOffset(beginning, "IntegerData1"));

                ret.ConstantBuffer = (uint)Marshal.ReadInt32(DataOffset(beginning, "ConstantBuffer"));
                ret.BinaryBuffer   = Marshal.ReadIntPtr(DataOffset(beginning, "BinaryBuffer"));

                return(ret);
            }
            public static PrinterNotifyInfo.Data Deserialize(IntPtr beginning)
            {
                var ret = new PrinterNotifyInfo.Data();
                ret.Type = (ushort)Marshal.ReadInt16(Offset(beginning, "Type"));
                ret.Field = (ushort)Marshal.ReadInt16(Offset(beginning, "Field"));
                ret.Reserved = (uint)Marshal.ReadInt32(Offset(beginning, "Reserved"));
                ret.ID = (uint)Marshal.ReadInt32(Offset(beginning, "ID"));

                ret.IntegerData0 = (uint)Marshal.ReadInt32(IntegerDataOffset(beginning, "IntegerData0"));
                ret.IntegerData1 = (uint)Marshal.ReadInt32(IntegerDataOffset(beginning, "IntegerData1"));

                ret.ConstantBuffer = (uint)Marshal.ReadInt32(DataOffset(beginning, "ConstantBuffer"));
                ret.BinaryBuffer = Marshal.ReadIntPtr(DataOffset(beginning, "BinaryBuffer"));

                return ret;
            }