public virtual bool Serialize(ILPMessageSerializer messageSerializer) { bool result = false; UInt16 size = 0; byte[] buf = null; if (LOG_ERROR(messageSerializer != null)) { goto Exit0; } // # begin serialize field # result = messageSerializer.WriteUInt16(MsgId); if (LOG_ERROR(result)) { goto Exit0; } result = messageSerializer.WriteUInt16(4); if (LOG_ERROR(result)) { goto Exit0; } // # end # buf = messageSerializer.GetSerializeBuf(); if (LOG_ERROR(buf != null)) { goto Exit0; } if (LOG_ERROR(messageSerializer.GetSerializeSize() <= LPMessageHeader.MAX_PACKET_LEN)) { goto Exit0; } size = (UInt16)messageSerializer.GetSerializeSize(); if (LOG_ERROR(size >= 4)) { goto Exit0; } buf[2] = (Byte)(size >> 8); buf[3] = (Byte)((size << 8) >> 8); return(true); Exit0: return(false); }
public override bool Serialize(ILPMessageSerializer messageSerializer) { bool result = false; UInt16 size = 0; byte[] buf = null; if (LOG_ERROR(messageSerializer != null)) { goto Exit0; } // # begin serialize field # result = base.Serialize(messageSerializer); if (LOG_ERROR(result)) { goto Exit0; } result = messageSerializer.WriteUInt8(byValue); if (LOG_ERROR(result)) { goto Exit0; } result = messageSerializer.WriteUInt16(wValue); if (LOG_ERROR(result)) { goto Exit0; } result = messageSerializer.WriteUInt32(dwValue); if (LOG_ERROR(result)) { goto Exit0; } result = messageSerializer.WriteUInt64(qwValue); if (LOG_ERROR(result)) { goto Exit0; } result = messageSerializer.WriteString(sValue); if (LOG_ERROR(result)) { goto Exit0; } // # end # buf = messageSerializer.GetSerializeBuf(); if (LOG_ERROR(buf != null)) { goto Exit0; } if (LOG_ERROR(messageSerializer.GetSerializeSize() <= LPMessageHeader.MAX_PACKET_LEN)) { goto Exit0; } size = (UInt16)messageSerializer.GetSerializeSize(); if (LOG_ERROR(size >= 4)) { goto Exit0; } buf[2] = (Byte)(size >> 8); buf[3] = (Byte)((size << 8) >> 8); return(true); Exit0: return(false); }