Beispiel #1
0
        public JsonValue ToJson(JsonSerializer serializer)
        {
            var json = new JsonObject();

            Id.Serialize(json, serializer, "id");
            Name.Serialize(json, serializer, "name");
            Desc.Serialize(json, serializer, "desc");
            Closed.Serialize(json, serializer, "closed");
            Pinned.Serialize(json, serializer, "pinned");
            Starred.Serialize(json, serializer, "starred");
            Subscribed.Serialize(json, serializer, "subscribed");
            Organization.SerializeId(json, "idOrganization");
            BoardSource.SerializeId(json, "idBoardSource");
            // Don't serialize the Preferences collection because Trello wants individual properties.
            if (Prefs != null)
            {
                Prefs.PermissionLevel.Serialize(json, serializer, "prefs/permissionLevel");
                Prefs.SelfJoin.Serialize(json, serializer, "prefs/selfJoin");
                Prefs.CardCovers.Serialize(json, serializer, "prefs/cardCovers");
                Prefs.Invitations.Serialize(json, serializer, "prefs/invitations");
                Prefs.Voting.Serialize(json, serializer, "prefs/voting");
                Prefs.Comments.Serialize(json, serializer, "prefs/comments");
                Prefs.CardAging.Serialize(json, serializer, "prefs/cardAging");
                Prefs.CalendarFeed.Serialize(json, serializer, "prefs/calendarFeedEnabled ");
                Prefs.Background.Serialize(json, serializer, "prefs/background");
            }
            return(json);
        }