Exemplo n.º 1
0
        public void Set(TrelloCard card, CardStatus status, bool propagateToNext = false)
        {
            if (!BoardAnalysis.Cards.Contains(card))
            {
                BoardAnalysis.Cards.Add(card);
            }
            switch (status)
            {
            case CardStatus.Other:
                if (Other.Contains(card))
                {
                    break;
                }

                Other.Add(card);
                removeFrom(card, Doing, Done);
                break;

            case CardStatus.Doing:
                if (Doing.Contains(card))
                {
                    break;
                }

                Doing.Add(card);
                removeFrom(card, Done, Other);
                break;

            case CardStatus.Done:
                if (Done.Contains(card))
                {
                    break;
                }

                Done.Add(card);
                removeFrom(card, Other, Doing);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(status), status, null);
            }
            if (propagateToNext)
            {
                ((PeriodCardsStatus)Next(false))?.Set(card, status);
            }
        }