public void Load(Beetle.IDataReader reader) { string type = reader.ReadUTF(); string data = reader.ReadString((int)(reader.Length - reader.Position)); Message = Newtonsoft.Json.JsonConvert.DeserializeObject(data, Package.GetType(type)); }
protected override Beetle.IMessage ReadMessageByType(Beetle.IDataReader reader, Beetle.ReadObjectInfo typeTag) { Adapter adapter = new Adapter(); typeTag.TypeofString = "Adapter"; return(adapter); }
protected override Beetle.IMessage ReadMessageByType(Beetle.IDataReader reader, Beetle.ReadObjectInfo typeTag) { typeTag.TypeOfInt = reader.ReadInt(); switch (typeTag.TypeOfInt) { case 1: return(new ListUsers()); case 2: return(new ListUsersResponse()); case 3: return(new Register()); case 4: return(new UnRegister()); case 5: return(new RegisterResponse()); case 6: return(new Say()); case 7: return(new OnRegister()); default: return(null); } }
protected override Beetle.IMessage ReadMessageByType(Beetle.IDataReader reader, Beetle.ReadObjectInfo typeTag) { typeTag.TypeofString = reader.ReadUTF(); switch (typeTag.TypeofString) { case "Register": return(new Register()); } return(null); }
public void Load(Beetle.IDataReader reader) { Name = reader.ReadUTF(); EMail = reader.ReadUTF(); City = reader.ReadUTF(); Country = reader.ReadUTF(); string date = reader.ReadUTF(); Console.WriteLine(date); RegTime = DateTime.ParseExact(date, "yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture); }
public void Load(Beetle.IDataReader reader) { string type = reader.ReadUTF(); Message = ProtoBuf.Meta.RuntimeTypeModel.Default.Deserialize((Stream)reader, null, Package.GetType(type)); }
public virtual void Load(Beetle.IDataReader reader) { ID = reader.ReadString(); }
public void Load(Beetle.IDataReader reader) { BinaryFormatter bf = new BinaryFormatter(); Message = bf.Deserialize((Stream)reader); }
public void Load(Beetle.IDataReader reader) { Name = reader.ReadUTF(); EMail = reader.ReadUTF(); ResponseTime = reader.ReadDateTime(); }
public override void Load(Beetle.IDataReader reader) { base.Load(reader); Name = reader.ReadString(); }
public override void Load(Beetle.IDataReader reader) { base.Load(reader); User = reader.ReadMessage <UserInfo>(); }
public void Load(Beetle.IDataReader reader) { Name = reader.ReadString(); IP = reader.ReadString(); }