Ejemplo n.º 1
0
        public BoardContext(string id, TrelloAuthorization auth)
            : base(auth)
        {
            Data.Id = id;

            Actions                 = new ReadOnlyActionCollection(typeof(Board), () => Data.Id, auth);
            Actions.Refreshed      += (s, e) => OnMerged(new[] { nameof(Actions) });
            Cards                   = new ReadOnlyCardCollection(typeof(Board), () => Data.Id, auth);
            Cards.Refreshed        += (s, e) => OnMerged(new[] { nameof(Cards) });
            CustomFields            = new CustomFieldDefinitionCollection(() => Data.Id, auth);
            CustomFields.Refreshed += (s, e) => OnMerged(new[] { nameof(CustomFields) });
            Labels                  = new BoardLabelCollection(() => Data.Id, auth);
            Labels.Refreshed       += (s, e) => OnMerged(new[] { nameof(Labels) });
            Lists                   = new ListCollection(() => Data.Id, auth);
            Lists.Refreshed        += (s, e) => OnMerged(new[] { nameof(Lists) });
            Members                 = new ReadOnlyMemberCollection(EntityRequestType.Board_Read_Members, () => Data.Id, auth);
            Members.Refreshed      += (s, e) => OnMerged(new[] { nameof(Members) });
            Memberships             = new BoardMembershipCollection(() => Data.Id, auth);
            Memberships.Refreshed  += (s, e) => OnMerged(new[] { nameof(Memberships) });
            PowerUps                = new PowerUpCollection(() => Data.Id, auth);
            PowerUps.Refreshed     += (s, e) => OnMerged(new[] { nameof(PowerUps) });
            PowerUpData             = new ReadOnlyPowerUpDataCollection(EntityRequestType.Board_Read_PowerUpData, () => Data.Id, auth);
            PowerUpData.Refreshed  += (s, e) => OnMerged(new[] { nameof(PowerUpData) });

            BoardPreferencesContext = new BoardPreferencesContext(Auth);
            BoardPreferencesContext.SubmitRequested += ct => HandleSubmitRequested("Preferences", ct);
            Data.Prefs = BoardPreferencesContext.Data;
        }
Ejemplo n.º 2
0
        public MemberContext(string id, bool isMe, TrelloAuthorization auth)
            : base(auth)
        {
            Data.Id = id;

            Actions = new ReadOnlyActionCollection(typeof(Member), () => Data.Id, auth);
            if (isMe)
            {
                Boards           = new BoardCollection(typeof(Member), () => Data.Id, auth);
                BoardBackgrounds = new BoardBackgroundCollection(() => Data.Id, auth);
                Organizations    = new OrganizationCollection(() => Data.Id, auth);
                StarredBoards    = new StarredBoardCollection(() => Data.Id, auth);
            }
            else
            {
                Boards           = new ReadOnlyBoardCollection(typeof(Member), () => Data.Id, auth);
                BoardBackgrounds = new ReadOnlyBoardBackgroundCollection(() => Data.Id, auth);
                Organizations    = new ReadOnlyOrganizationCollection(() => Data.Id, auth);
                StarredBoards    = new ReadOnlyStarredBoardCollection(() => Data.Id, auth);
            }
            Boards.Refreshed           += (s, e) => OnMerged(new[] { nameof(Boards) });
            BoardBackgrounds.Refreshed += (s, e) => OnMerged(new[] { nameof(BoardBackgrounds) });
            Organizations.Refreshed    += (s, e) => OnMerged(new[] { nameof(Organizations) });
            StarredBoards.Refreshed    += (s, e) => OnMerged(new[] { nameof(StarredBoards) });
            Cards                    = new ReadOnlyCardCollection(EntityRequestType.Member_Read_Cards, () => Data.Id, auth);
            Cards.Refreshed         += (s, e) => OnMerged(new[] { nameof(Cards) });
            Notifications            = new ReadOnlyNotificationCollection(() => Data.Id, auth);
            Notifications.Refreshed += (s, e) => OnMerged(new[] { nameof(Notifications) });

            MemberPreferencesContext = new MemberPreferencesContext(Auth);
            MemberPreferencesContext.SubmitRequested += ct => HandleSubmitRequested("Preferences", ct);
            Data.Prefs = MemberPreferencesContext.Data;
        }
Ejemplo n.º 3
0
        public MemberContext(string id, bool isMe, TrelloAuthorization auth)
            : base(auth)
        {
            Data.Id = id;

            Actions = new ReadOnlyActionCollection(typeof(Member), () => Data.Id, auth);
            Boards  = isMe
                                         ? new BoardCollection(typeof(Member), () => Data.Id, auth)
                                         : new ReadOnlyBoardCollection(typeof(Member), () => Data.Id, auth);
            Cards         = new ReadOnlyCardCollection(EntityRequestType.Member_Read_Cards, () => Data.Id, auth);
            Organizations = isMe
                                                ? new OrganizationCollection(() => Data.Id, auth)
                                                : new ReadOnlyOrganizationCollection(() => Data.Id, auth);
            Notifications = new ReadOnlyNotificationCollection(() => Data.Id, auth);

            MemberPreferencesContext = new MemberPreferencesContext(Auth);
            MemberPreferencesContext.SubmitRequested += ct => HandleSubmitRequested("Preferences", ct);
            Data.Prefs = MemberPreferencesContext.Data;
        }