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;
                });
        }
Exemplo n.º 2
0
        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);
 }
Exemplo n.º 4
0
		public ActionsForListRequest(IListId list, ISince since, Paging paging, IEnumerable<ActionType> filter)
			: base(list, "actions")
		{
			this.AddTypeFilter(filter);
			this.AddSince(since);
			this.AddPaging(paging);
		}
Exemplo n.º 5
0
        public NewCard(string name, IListId list)
        {
            Guard.NotNullOrEmpty(name, "name");
            Guard.NotNull(list, "list");

            Name = name;
            IdList = list.GetListId();
        }
Exemplo n.º 6
0
        public CardsForListRequest(IListId list, CardFilter filter, IEnumerable<ActionType> includeActions = null)
			: base(list, "cards")
		{
			this.AddCommonCardParameters();
			this.AddFilter(filter);
            this.AddTypeInclude(includeActions);
            
		}
Exemplo n.º 7
0
		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);
        }
Exemplo n.º 9
0
        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;
                });
        }
Exemplo n.º 12
0
        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));
        }
Exemplo n.º 13
0
 public CardsForListRequest(IListId list, CardFilter filter)
     : base(list, "cards")
 {
     this.AddCommonCardParameters();
     this.AddFilter(filter);
 }
Exemplo n.º 14
0
 public Task<Card> Add(string name, IListId list)
 {
     return Add(new NewCard(name, list));
 }
Exemplo n.º 15
0
 public void ChangeName(IListId list, string name)
 {
     _restClient.Request(new ListsChangeNameRequest(list, name));
 }
Exemplo n.º 16
0
 public Task ChangeName(IListId list, string name)
 {
     return(_restClient.RequestAsync(new ListsChangeNameRequest(list, name)));
 }
Exemplo n.º 17
0
		public BoardsForListRequest(IListId list)
			: base(list, "board")
		{
		}
Exemplo n.º 18
0
 public void Move(ICardId card, IListId list)
 {
     _restClient.Request(new CardsMoveRequest(card, list));
 }
Exemplo n.º 19
0
 public ListsChangePosRequest(IListId list, double pos)
     : base(list, "pos", Method.PUT)
 {
     Guard.Positive(pos, "pos");
     this.AddValue(pos);
 }
Exemplo n.º 20
0
 public Task Move(ICardId card, IBoardId board, IListId list = null)
 {
     return(_restClient.RequestAsync(new CardsMoveToBoardRequest(card, board, list)));
 }
Exemplo n.º 21
0
 public Task <IEnumerable <Card> > ForList(IListId list, CardFilter filter = CardFilter.Open)
 {
     return(_restClient.RequestListAsync <Card>(new CardsForListRequest(list, filter)));
 }
Exemplo n.º 22
0
		public IEnumerable<Card> ForList(IListId list, CardFilter filter = CardFilter.Open, IEnumerable<ActionType> actionIncludes = null)
		{
            return _restClient.Request<List<Card>>(new CardsForListRequest(list, filter, actionIncludes));
		}
Exemplo n.º 23
0
 public Task Move(ICardId card, IListId list)
 {
     return(_restClient.RequestAsync(new CardsMoveRequest(card, list)));
 }
Exemplo n.º 24
0
		public void ChangePos(IListId list, Position pos)
		{
			_restClient.Request(new ListsChangePosRequest(list, pos));
		}
Exemplo n.º 25
0
 public void Unarchive(IListId list)
 {
     _restClient.Request(new ListsUnarchiveRequest(list));
 }
Exemplo n.º 26
0
 public void ChangePos(IListId list, Position pos)
 {
     _restClient.Request(new ListsChangePosRequest(list, pos));
 }
Exemplo n.º 27
0
 public ListsSendToBoardRequest(IListId list)
     : base(list, "closed", Method.PUT)
 {
     this.AddValue("false");
 }
Exemplo n.º 28
0
		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);			
		}
Exemplo n.º 29
0
 public IEnumerable <Card> ForList(IListId list, CardFilter filter = CardFilter.Open)
 {
     return(_restClient.Request <List <Card> >(new CardsForListRequest(list, filter)));
 }
Exemplo n.º 30
0
		public ListsArchiveRequest(IListId list)
			: base(list, "closed", Method.PUT)
		{
			this.AddValue("true");			
		}
Exemplo n.º 31
0
 public void Archive(IListId list)
 {
     _restClient.Request(new ListsArchiveRequest(list));
 }
Exemplo n.º 32
0
 public Board ForList(IListId list)
 {
     return(_restClient.Request <Board>(new BoardsForListRequest(list)));
 }
Exemplo n.º 33
0
 public Task Unarchive(IListId list)
 {
     return(_restClient.RequestAsync(new ListsUnarchiveRequest(list)));
 }
Exemplo n.º 34
0
		public Board ForList(IListId list)
		{
			return _restClient.Request<Board>(new BoardsForListRequest(list));
		}
Exemplo n.º 35
0
 public Task ChangePos(IListId list, Position pos)
 {
     return(_restClient.RequestAsync(new ListsChangePosRequest(list, pos)));
 }
Exemplo n.º 36
0
		public void Move(ICardId card, IBoardId board, IListId list = null)
		{
			_restClient.Request(new CardsMoveToBoardRequest(card, board, list));
		}
Exemplo n.º 37
0
 public Task Move(ICardId card, IListId list)
 {
     return _restClient.RequestAsync(new CardsMoveRequest(card, list));
 }
Exemplo n.º 38
0
		public Card Add(string name, IListId list)
		{
			return Add(new NewCard(name, list));
		}
Exemplo n.º 39
0
 public Task<IEnumerable<Card>> ForList(IListId list, CardFilter filter = CardFilter.Default)
 {
     return _restClient.RequestListAsync<Card>(new CardsForListRequest(list, filter));
 }
Exemplo n.º 40
0
 public ListsUnarchiveRequest(IListId list)
     : base(list, "closed", Method.PUT)
 {
     this.AddValue("false");
 }
Exemplo n.º 41
0
 public CardsMoveRequest(ICardId card, IListId list)
     : base(card, "idList", Method.PUT)
 {
     Guard.NotNull(list, "list");
     this.AddValue(list.GetListId());
 }
Exemplo n.º 42
0
 public ListsChangePosRequest(IListId list, Position pos)
     : base(list, "pos", Method.PUT)
 {
     this.AddValue(pos.ToTrelloString());
 }
Exemplo n.º 43
0
		public IEnumerable<Card> ForList(IListId list, CardFilter filter = CardFilter.Open)
		{
			return _restClient.Request<List<Card>>(new CardsForListRequest(list, filter));
		}
Exemplo n.º 44
0
 /// <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;
 }
Exemplo n.º 45
0
		public void Move(ICardId card, IListId list)
		{
			_restClient.Request(new CardsMoveRequest(card, list));
		}
Exemplo n.º 46
0
 public ListsChangeNameRequest(IListId list, string name)
     : base(list, "name", Method.PUT)
 {
     Guard.NotNullOrEmpty(name, "name");
     this.AddValue(name);
 }
Exemplo n.º 47
0
 public ListsChangeNameRequest(IListId list, string name)
     : base(list, "name", Method.PUT)
 {
     Guard.RequiredTrelloString(name, "name");
     this.AddValue(name);
 }
Exemplo n.º 48
0
 public void SendToBoard(IListId list)
 {
     _restClient.Request(new ListsSendToBoardRequest(list));
 }
Exemplo n.º 49
0
 public void Move(ICardId card, IBoardId board, IListId list = null)
 {
     _restClient.Request(new CardsMoveToBoardRequest(card, board, 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)));
 }
Exemplo n.º 51
0
 public Card Add(string name, IListId list)
 {
     return(Add(new NewCard(name, list)));
 }
Exemplo n.º 52
0
        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++))));
        }
Exemplo n.º 53
0
 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));
 }
Exemplo n.º 54
0
 public Board GetByList(IListId list)
 {
     Guard.NotNull(list, "list");
     return _restClient.Request<Board>(new ListBoardRequest(list));
 }
Exemplo n.º 55
0
 public void ChangeName(IListId list, string name)
 {
     _restClient.Request(new ListsChangeNameRequest(list, name));
 }
Exemplo n.º 56
0
		public Task<Board> ForList(IListId list)
		{
			return _restClient.RequestAsync<Board>(new BoardsForListRequest(list));
		}
Exemplo n.º 57
0
 public Task<Board> ForList(IListId list)
 {
     return _restClient.RequestAsync<Board>(new BoardsForListRequest(list));
 }
Exemplo n.º 58
0
 public Task Move(ICardId card, IBoardId board, IListId list = null)
 {
     return _restClient.RequestAsync(new CardsMoveToBoardRequest(card, board, list));
 }
Exemplo n.º 59
0
 public BoardsForListRequest(IListId list)
     : base(list, "board")
 {
 }
Exemplo n.º 60
0
 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);
 }