public IEnumerable<CardInfo> CreateCards(Grid grid, IListId list) { if(!grid.Cells.Any()) return Enumerable.Empty<CardInfo>(); var leftMostColumn = grid.Cells.Min(c => c.Column); return grid.Cells.OrderBy(c => c.Row).ThenBy(c => c.Column) .GroupBy(c => c.Row) .Where(c => c.Any(x => x.Column == leftMostColumn)) .Select(c => { var newCard = new CardInfo { Name = c.First().Value, ListId = list }; var skipFirstColumn = c.Skip(1); var firstDateColumn = skipFirstColumn.FirstOrDefault(dc => dc.Type == typeof (DateTime)); if (firstDateColumn != null) newCard.Due = DateTime.Parse(firstDateColumn.Value); var firstStringColumn = skipFirstColumn.FirstOrDefault(sc => sc.Type == typeof (string)); if(firstStringColumn != null) newCard.Desc = firstStringColumn.Value; return newCard; }); }
public IEnumerable <CardInfo> CreateCards(Grid grid, IListId list) { if (!grid.Cells.Any()) { return(Enumerable.Empty <CardInfo>()); } var leftMostColumn = grid.Cells.Min(c => c.Column); return(grid.Cells.OrderBy(c => c.Row).ThenBy(c => c.Column) .GroupBy(c => c.Row) .Where(c => c.Any(x => x.Column == leftMostColumn)) .Select(c => { var newCard = new CardInfo { Name = c.First().Value, ListId = list }; var skipFirstColumn = c.Skip(1); var firstDateColumn = skipFirstColumn.FirstOrDefault(dc => dc.Type == typeof(DateTime)); if (firstDateColumn != null) { newCard.Due = DateTime.Parse(firstDateColumn.Value); } var firstStringColumn = skipFirstColumn.FirstOrDefault(sc => sc.Type == typeof(string)); if (firstStringColumn != null) { newCard.Desc = firstStringColumn.Value; } return newCard; })); }
public ActionsForListRequest(IListId list, ISince since, Paging paging, IEnumerable <ActionType> filter) : base(list, "actions") { this.AddTypeFilter(filter); this.AddSince(since); this.AddPaging(paging); }
public ActionsForListRequest(IListId list, ISince since, Paging paging, IEnumerable<ActionType> filter) : base(list, "actions") { this.AddTypeFilter(filter); this.AddSince(since); this.AddPaging(paging); }
public NewCard(string name, IListId list) { Guard.NotNullOrEmpty(name, "name"); Guard.NotNull(list, "list"); Name = name; IdList = list.GetListId(); }
public CardsForListRequest(IListId list, CardFilter filter, IEnumerable<ActionType> includeActions = null) : base(list, "cards") { this.AddCommonCardParameters(); this.AddFilter(filter); this.AddTypeInclude(includeActions); }
public CardsMoveToBoardRequest(ICardId card, IBoardId board, IListId list) : base(card, "idBoard", Method.PUT) { Guard.NotNull(board, "board"); this.AddValue(board.GetBoardId()); if (list != null) AddParameter("idList", list.GetListId()); }
public IEnumerable<NewCard> CreateCards(IListId list) { var grid = new Grid(); foreach (Range cell in GetSelectedRange()) grid.AddCell(cell.Column, cell.Row, Convert.ToString(cell.Value)); return CreateCards(grid, list); }
public CardsMoveToBoardRequest(ICardId card, IBoardId board, IListId list) : base(card, "idBoard", Method.PUT) { Guard.NotNull(board, "board"); this.AddValue(board.GetBoardId()); if (list != null) { AddParameter("idList", list.GetListId()); } }
public IEnumerable<CardInfo> CreateCards(IListId list) { var grid = new Grid(); var selectedRange = GetSelectedRange(); if(selectedRange == null) return Enumerable.Empty<CardInfo>(); foreach (Range cell in selectedRange) grid.AddCell(cell.Column, cell.Row, Convert.ToString(cell.Value), cell.Value.GetType()); return CreateCards(grid, list); }
public IEnumerable<NewCard> CreateCards(Grid grid, IListId list) { if(!grid.Cells.Any()) return Enumerable.Empty<NewCard>(); var leftMostColumn = grid.Cells.Min(c => c.Column); return grid.Cells .GroupBy(c => c.Row) .Where(c => c.Any(x => x.Column == leftMostColumn)) .Select(c => { var newCard = new NewCard(c.First().Value, list); if (c.Count() > 1) newCard.Desc = c.ElementAt(1).Value; return newCard; }); }
public IEnumerable <CardInfo> CreateCards(IListId list) { var grid = new Grid(); var selectedRange = GetSelectedRange(); if (selectedRange == null) { return(Enumerable.Empty <CardInfo>()); } foreach (Range cell in selectedRange) { grid.AddCell(cell.Column, cell.Row, Convert.ToString(cell.Value), cell.Value.GetType()); } return(CreateCards(grid, list)); }
public CardsForListRequest(IListId list, CardFilter filter) : base(list, "cards") { this.AddCommonCardParameters(); this.AddFilter(filter); }
public Task<Card> Add(string name, IListId list) { return Add(new NewCard(name, list)); }
public void ChangeName(IListId list, string name) { _restClient.Request(new ListsChangeNameRequest(list, name)); }
public Task ChangeName(IListId list, string name) { return(_restClient.RequestAsync(new ListsChangeNameRequest(list, name))); }
public BoardsForListRequest(IListId list) : base(list, "board") { }
public void Move(ICardId card, IListId list) { _restClient.Request(new CardsMoveRequest(card, list)); }
public ListsChangePosRequest(IListId list, double pos) : base(list, "pos", Method.PUT) { Guard.Positive(pos, "pos"); this.AddValue(pos); }
public Task Move(ICardId card, IBoardId board, IListId list = null) { return(_restClient.RequestAsync(new CardsMoveToBoardRequest(card, board, list))); }
public Task <IEnumerable <Card> > ForList(IListId list, CardFilter filter = CardFilter.Open) { return(_restClient.RequestListAsync <Card>(new CardsForListRequest(list, filter))); }
public IEnumerable<Card> ForList(IListId list, CardFilter filter = CardFilter.Open, IEnumerable<ActionType> actionIncludes = null) { return _restClient.Request<List<Card>>(new CardsForListRequest(list, filter, actionIncludes)); }
public Task Move(ICardId card, IListId list) { return(_restClient.RequestAsync(new CardsMoveRequest(card, list))); }
public void ChangePos(IListId list, Position pos) { _restClient.Request(new ListsChangePosRequest(list, pos)); }
public void Unarchive(IListId list) { _restClient.Request(new ListsUnarchiveRequest(list)); }
public ListsSendToBoardRequest(IListId list) : base(list, "closed", Method.PUT) { this.AddValue("false"); }
public ListsRequest(IListId list, string resource = "", Method method = Method.GET) : base("list/{listId}/" + resource, method) { Guard.NotNull(list, "list"); AddParameter("listId", list.GetListId(), ParameterType.UrlSegment); }
public IEnumerable <Card> ForList(IListId list, CardFilter filter = CardFilter.Open) { return(_restClient.Request <List <Card> >(new CardsForListRequest(list, filter))); }
public ListsArchiveRequest(IListId list) : base(list, "closed", Method.PUT) { this.AddValue("true"); }
public void Archive(IListId list) { _restClient.Request(new ListsArchiveRequest(list)); }
public Board ForList(IListId list) { return(_restClient.Request <Board>(new BoardsForListRequest(list))); }
public Task Unarchive(IListId list) { return(_restClient.RequestAsync(new ListsUnarchiveRequest(list))); }
public Board ForList(IListId list) { return _restClient.Request<Board>(new BoardsForListRequest(list)); }
public Task ChangePos(IListId list, Position pos) { return(_restClient.RequestAsync(new ListsChangePosRequest(list, pos))); }
public void Move(ICardId card, IBoardId board, IListId list = null) { _restClient.Request(new CardsMoveToBoardRequest(card, board, list)); }
public Task Move(ICardId card, IListId list) { return _restClient.RequestAsync(new CardsMoveRequest(card, list)); }
public Card Add(string name, IListId list) { return Add(new NewCard(name, list)); }
public Task<IEnumerable<Card>> ForList(IListId list, CardFilter filter = CardFilter.Default) { return _restClient.RequestListAsync<Card>(new CardsForListRequest(list, filter)); }
public ListsUnarchiveRequest(IListId list) : base(list, "closed", Method.PUT) { this.AddValue("false"); }
public CardsMoveRequest(ICardId card, IListId list) : base(card, "idList", Method.PUT) { Guard.NotNull(list, "list"); this.AddValue(list.GetListId()); }
public ListsChangePosRequest(IListId list, Position pos) : base(list, "pos", Method.PUT) { this.AddValue(pos.ToTrelloString()); }
public IEnumerable<Card> ForList(IListId list, CardFilter filter = CardFilter.Open) { return _restClient.Request<List<Card>>(new CardsForListRequest(list, filter)); }
/// <param name="name">A string with a length from 1 to 16384.</param> /// <param name="list">Id of the list that the card should be added to.</param> public NewCard(string name, IListId list) { Name = name; IdList = list; }
public ListsChangeNameRequest(IListId list, string name) : base(list, "name", Method.PUT) { Guard.NotNullOrEmpty(name, "name"); this.AddValue(name); }
public ListsChangeNameRequest(IListId list, string name) : base(list, "name", Method.PUT) { Guard.RequiredTrelloString(name, "name"); this.AddValue(name); }
public void SendToBoard(IListId list) { _restClient.Request(new ListsSendToBoardRequest(list)); }
public Task <IEnumerable <Action> > ForList(IListId list, IEnumerable <ActionType> filter = null, ISince since = null, Paging paging = null) { return(_restClient.RequestListAsync <Action>(new ActionsForListRequest(list, since, paging, filter))); }
public Card Add(string name, IListId list) { return(Add(new NewCard(name, list))); }
public IEnumerable <Action> ForList(IListId list, IEnumerable <ActionType> filter = null, ISince since = null) { var currentPage = 0; return(AutoPage(() => _trelloActions.ForList(list, filter, since, new Paging(_pageSize, currentPage++)))); }
public IEnumerable<Action> ForList(IListId list, IEnumerable<ActionType> filter = null, ISince since = null, Paging paging = null) { return _restClient.Request<List<Action>>(new ActionsForListRequest(list, since, paging, filter)); }
public Board GetByList(IListId list) { Guard.NotNull(list, "list"); return _restClient.Request<Board>(new ListBoardRequest(list)); }
public Task<Board> ForList(IListId list) { return _restClient.RequestAsync<Board>(new BoardsForListRequest(list)); }
public Task Move(ICardId card, IBoardId board, IListId list = null) { return _restClient.RequestAsync(new CardsMoveToBoardRequest(card, board, list)); }
public ListsRequest(IListId list, string resource = "", Method method = Method.GET) : base("lists/{listId}/" + resource, method) { Guard.NotNull(list, "list"); AddParameter("listId", list.GetListId(), ParameterType.UrlSegment); }