public ActivityPost ParseFromJson(Dictionary <string, object> json)
        {
            Id   = (string)json["Id"];
            Text = json["Text"] as string;

            ImageUrl    = json["ImageUrl"] as string;
            ButtonTitle = json["ButtonTitle"] as string;
#pragma warning disable 0618
            ButtonAction = json["ButtonAction"] as string;
#pragma warning restore 0618
            var action = json["Action"] as Dictionary <string, object>;
            if (action != null)
            {
                Action = new GetSocialAction().ParseFromJson(action);
            }
            CreatedAt = DateUtils.FromUnixTime((long)json["CreatedAt"]);

            var authorDic = json["Author"] as Dictionary <string, object>;
            Author = new PostAuthor().ParseFromJson(authorDic);

            CommentsCount = (int)(long)json["CommentsCount"];
            LikesCount    = (int)(long)json["LikesCount"];
            IsLikedByMe   = (bool)json["IsLikedByMe"];

            StickyStart = DateUtils.FromUnixTime((long)json["StickyStart"]);
            StickyEnd   = DateUtils.FromUnixTime((long)json["StickyEnd"]);
            Mentions    = GSJsonUtils.ParseList <Mention>(json["Mentions"] as string);
            FeedId      = json["FeedId"] as string;

            return(this);
        }
예제 #2
0
 static void GetObjectCallback <T>(IntPtr actionPtr, string json) where T : IConvertableFromNative <T>, new()
 {
     if (actionPtr != IntPtr.Zero)
     {
         var result = GSJsonUtils.Parse <T>(json);
         IOSUtils.TriggerCallback(actionPtr, result);
     }
 }
예제 #3
0
        static void GetObjectsDictionaryCallback <TValue>(IntPtr actionPtr, string json) where TValue : IConvertableFromNative <TValue>, new()
        {
            var result = GSJsonUtils.ParseDictionary <PublicUser>(json);

            IOSUtils.TriggerCallback(actionPtr, result);
        }