public override void Serialize(BinaryWriter w) { base.Serialize(w); if (RetVal != null) { w.Write(true); w.Write((int)RetVal.Count); foreach (var element in RetVal) { ChatUserInfoSerializer.Serialize(element, w); } } else { w.Write(false); } }
public override void Deserialize(BinaryReader r) { base.Deserialize(r); { if (!r.ReadBoolean()) { RetVal = null; } else { int lenght = r.ReadInt32(); var list = new List <ChatUserInfo>(lenght); for (int i = 0; i < lenght; i++) { var x = ChatUserInfoSerializer.Deserialize(r); list.Add(x); } RetVal = list; } } }
public override void Deserialize(BinaryReader r) { base.Deserialize(r); user = ChatUserInfoSerializer.Deserialize(r); }
public override void Serialize(BinaryWriter w) { base.Serialize(w); ChatUserInfoSerializer.Serialize(user, w); }