public void AttachToCard(string boardName, string listName, string cardName, string fileToAttach)
        {
            if (!File.Exists(fileToAttach))
                throw new FileNotFoundException("File not found", fileToAttach);

            var listid = new ListId(trello.Lists.ForBoard(trello.Boards.ForMe().First(b => b.Name == boardName))
                .First(l => l.Name == listName).GetListId());
            var card = trello.Cards.ForList(listid)
                .First(c => c.Name == cardName).GetCardId();
            var cardid = new CardId(card);

            trello.Cards.AddAttachment(cardid, new FileAttachment(fileToAttach));
        }
Пример #2
0
 private bool addComment(string boardId, int cardNumber, string comment, string userToken)
 {
     trello.Authorize(userToken);
     var bId = new BoardId(boardId);
     var card = trello.Cards.WithShortId(cardNumber, bId);
     var cardId = new CardId(card.Id);
     trello.Cards.AddComment(cardId, "Commit added: " + comment);
     return true;
 }
        public void AddCard(string boardName, string listName, string cardName, string commentText = "")
        {
            if(string.IsNullOrWhiteSpace(commentText))
                throw new Exception("Cannot add empty comment");

            var listid = new ListId(trello.Lists.ForBoard(trello.Boards.ForMe().First(b => b.Name == boardName))
                .First(l => l.Name == listName).GetListId());
            var card = trello.Cards.Add(cardName, listid);
            var cardid = new CardId(card.GetCardId());

            trello.Cards.AddComment(cardid, commentText);
        }