Inheritance: ObservableObject
Esempio n. 1
0
        public static Board Parse(JObject obj, bool deptParse = false)
        {
            if (obj == null)
                return null;

            Board board = new Board();
            try
            {
                if (obj.GetObject<int>("is_private") > 0)
                    return null;
                board.board_id = obj.GetObject<string>("board_id");
                board.user_id = obj.GetObject<string>("user_id");
                board.description = obj.GetObject<string>("description");
                board.title = HtmlDecode(obj.GetObject<string>("title"));
                board.category_id = obj.GetObject<string>("category_id");
                board.pin_count = obj.GetObject<string>("pin_count");
                board.follow_count = obj.GetObject<string>("follow_count");
                board.like_count = obj.GetObject<string>("like_count");
                board.created_at = obj.GetObject<string>("created_at");
                board.updated_at = obj.GetObject<string>("updated_at");

                board.following = obj.GetObject<bool>("following");
                board.user = User.Parse(obj["user"] as JObject);
                board.cover = Pin.Parse(obj["cover"] as JObject);
                board.seq = obj.GetObject<int>("seq");

                board.pins = Pin.ParseList(obj["pins"] as JArray);
                if (board.cover == null && board.pins != null && board.pins.Count > 0)
                    board.cover = board.pins[0];

            }
            catch (Exception ex)
            {
                string aaa = ex.Message;
            }
            return board;
        }