Пример #1
0
        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>();
            }
        }
Пример #2
0
        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>();
            }
        }
Пример #3
0
        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);
        }
Пример #6
0
        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);
        }
Пример #8
0
        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>();
                }
            }
        }
Пример #9
0
        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);
        }
Пример #10
0
 public abstract void Decode(MessagePayload payload);
Пример #11
0
 public override void decode(MessagePayload payload)
 {
     content = payload.content;
 }
Пример #12
0
 public override void decode(MessagePayload payload)
 {
     content = payload.searchableContent;
 }
Пример #13
0
 public void decode(MessagePayload payload)
 {
     localPath = payload.localContent;
     remoteUrl = payload.remoteMediaUrl;
     mediaType = payload.mediaType;
 }
Пример #14
0
 public override void decode(MessagePayload payload)
 {
     typingType = Int32.Parse(payload.content);
 }
Пример #15
0
 public override void decode(MessagePayload payload)
 {
     rawPayload = payload;
 }
Пример #16
0
 public override void decode(MessagePayload payload)
 {
     base.decode(payload);
     payload.binaryContent = thumbnailBytes;
 }
Пример #17
0
 public override void decode(MessagePayload payload)
 {
     base.decode(payload);
     thumbnailData = payload.binaryContent;
 }
Пример #18
0
 public override void Decode(MessagePayload payload)
 {
     _typingType = int.Parse(payload.Content);
 }