public override void decode(MessagePayload payload) { title = payload.searchableContent; thumbnailData = payload.binaryContent; JObject jo = (JObject)JsonConvert.DeserializeObject(payload.content); if (jo["c"] != null) { content = jo["c"].Value <string>(); } if (jo["u"] != null) { url = jo["u"].Value <string>(); } }
public override void Decode(MessagePayload payload) { ThumbnailData = payload.BinaryContent; Title = payload.SearchableContent; JObject jo = (JObject)JsonConvert.DeserializeObject(payload.Content); if (jo["lat"] != null) { Lat = jo["lat"].Value <double>(); } if (jo["long"] != null) { Lng = jo["long"].Value <double>(); } }
public override void decode(MessagePayload payload) { thumbnailData = payload.binaryContent; title = payload.searchableContent; JObject jo = (JObject)JsonConvert.DeserializeObject(payload.content); if (jo["lat"] != null) { lat = jo["lat"].Value <double>(); } if (jo["long"] != null) { lng = jo["long"].Value <double>(); } }
public override void Decode(MessagePayload payload) { base.Decode(payload); string json = Encoding.UTF8.GetString(payload.BinaryContent); JObject jo = (JObject)JsonConvert.DeserializeObject(json); if (jo["x"] != null) { Width = jo["x"].Value <int>(); } if (jo["y"] != null) { Height = jo["y"].Value <int>(); } }
public override MessagePayload Encode() { MessagePayload payload = new MessagePayload(); payload.Content = CallId; StringWriter sw = new StringWriter(); JsonWriter writer = new JsonTextWriter(sw); writer.WriteStartObject(); if (ConnectTime > 0) { writer.WritePropertyName("c"); writer.WriteValue(ConnectTime); } if (EndTime > 0) { writer.WritePropertyName("e"); writer.WriteValue(EndTime); } if (Status > 0) { writer.WritePropertyName("s"); writer.WriteValue(Status); } writer.WritePropertyName("t"); writer.WriteValue(TargetId); writer.WritePropertyName("a"); writer.WriteValue(AudioOnly ? 1 : 0); writer.WriteEndObject(); writer.Flush(); string jsonText2 = sw.GetStringBuilder().ToString(); payload.BinaryContent = Encoding.UTF8.GetBytes(jsonText2); return(payload); }
public override MessagePayload encode() { MessagePayload payload = base.encode(); payload.searchableContent = "[语音]"; StringWriter sw = new StringWriter(); JsonWriter writer = new JsonTextWriter(sw); writer.WriteStartObject(); writer.WritePropertyName("duration"); writer.WriteValue(duration); writer.WriteEndObject(); writer.Flush(); string jsonText2 = sw.GetStringBuilder().ToString(); payload.content = jsonText2; return(payload); }
public override MessagePayload Encode() { MessagePayload payload = base.Encode(); StringWriter sw = new StringWriter(); JsonWriter writer = new JsonTextWriter(sw); writer.WriteStartObject(); writer.WritePropertyName("x"); writer.WriteValue(Width); writer.WritePropertyName("y"); writer.WriteValue(Height); writer.WriteEndObject(); writer.Flush(); string jsonText2 = sw.GetStringBuilder().ToString(); payload.BinaryContent = Encoding.UTF8.GetBytes(jsonText2); return(payload); }
public override void Decode(MessagePayload payload) { Title = payload.SearchableContent; string json = Encoding.UTF8.GetString(payload.BinaryContent); JObject jo = (JObject)JsonConvert.DeserializeObject(json); if (jo != null) { if (jo["d"] != null) { Content = jo["d"].Value <string>(); } if (jo["u"] != null) { Url = jo["u"].Value <string>(); } if (jo["t"] != null) { ThumbnailUrl = jo["t"].Value <string>(); } } }
public override MessagePayload Encode() { MessagePayload payload = new MessagePayload(); payload.SearchableContent = Title; StringWriter sw = new StringWriter(); JsonWriter writer = new JsonTextWriter(sw); writer.WriteStartObject(); if (Content != null) { writer.WritePropertyName("d"); writer.WriteValue(Content); } if (Url != null) { writer.WritePropertyName("u"); writer.WriteValue(Url); } if (ThumbnailUrl != null) { writer.WritePropertyName("t"); writer.WriteValue(ThumbnailUrl); } writer.WriteEndObject(); writer.Flush(); string jsonText2 = sw.GetStringBuilder().ToString(); payload.BinaryContent = Encoding.UTF8.GetBytes(jsonText2); return(payload); }
public abstract void Decode(MessagePayload payload);
public override void decode(MessagePayload payload) { content = payload.content; }
public override void decode(MessagePayload payload) { content = payload.searchableContent; }
public void decode(MessagePayload payload) { localPath = payload.localContent; remoteUrl = payload.remoteMediaUrl; mediaType = payload.mediaType; }
public override void decode(MessagePayload payload) { typingType = Int32.Parse(payload.content); }
public override void decode(MessagePayload payload) { rawPayload = payload; }
public override void decode(MessagePayload payload) { base.decode(payload); payload.binaryContent = thumbnailBytes; }
public override void decode(MessagePayload payload) { base.decode(payload); thumbnailData = payload.binaryContent; }
public override void Decode(MessagePayload payload) { _typingType = int.Parse(payload.Content); }