internal BoardBackground(IJsonBoardBackground json, TrelloAuthorization auth) { Id = json.Id; _context = new BoardBackgroundContext(auth); _context.Merge(json); _color = new Field <WebColor>(_context, nameof(Color)); _image = new Field <string>(_context, nameof(Image)); _isTiled = new Field <bool?>(_context, nameof(IsTiled)); ScaledImages = new ReadOnlyBoardBackgroundScalesCollection(_context, auth); TrelloConfiguration.Cache.Add(this); }
public int GetHashCode(IJsonBoardBackground obj) { if (obj == null) { return(0); } unchecked { var hashCode = obj.Id?.GetHashCode() ?? 0; hashCode = (hashCode * 397) ^ (obj.Color?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (obj.Image?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ GetCollectionHashCode(obj.ImageScaled, Instance); hashCode = (hashCode * 397) ^ obj.Tile.GetHashCode(); return(hashCode); } }
public void FromJson(JsonValue json, JsonSerializer serializer) { if (json.Type != JsonValueType.Object) { return; } var obj = json.Object; PermissionLevel = obj.Deserialize <BoardPermissionLevel?>(serializer, "permissionLevel"); Voting = obj.Deserialize <BoardVotingPermission?>(serializer, "voting"); Comments = obj.Deserialize <BoardCommentPermission?>(serializer, "comments"); Invitations = obj.Deserialize <BoardInvitationPermission?>(serializer, "invitations"); SelfJoin = obj.TryGetBoolean("selfJoin"); CardCovers = obj.TryGetBoolean("cardCovers"); CalendarFeed = obj.TryGetBoolean("calendarFeed"); CardAging = obj.Deserialize <CardAgingStyle?>(serializer, "cardAging"); Background = serializer.Deserialize <IJsonBoardBackground>(obj); }
public bool Equals(IJsonBoardBackground x, IJsonBoardBackground y) { if (x == null && y != null) { return(false); } if (x != null && y == null) { return(false); } if (x == null) { return(true); } return(x.Id == y.Id && x.Color == y.Color && x.Image == y.Image && (x.ImageScaled?.SequenceEqual(y.ImageScaled) ?? true) && x.Tile == y.Tile); }