Ejemplo n.º 1
0
 public void AddBoard(string username, string boardname, string description, bool isPublic)
 {
     var id = _idGen++;
     var b = new Board(boardname, description, id);
     var registery = new Registery(b, username, isPublic);
     _regist.Add(id, registery);
 }
Ejemplo n.º 2
0
 public Registery(Board b, string username, bool canView)
 {
     IsPublic = canView;
     Author = username;
     Users = new List<UserProperty>();
     Users.Add(new UserProperty(username,true));
       //  IsPublic = canContribute;
     Board = b;
 }
Ejemplo n.º 3
0
 public static BoardShow Convert(Board b, bool isPublic, bool isEditable)
 {
     return new BoardShow
     {
         IsEditable = isEditable,
         List = b.Lists.Select(list => Convert(list,isEditable)),
         Name = b.Name,
         Description = b.Description,
         IsPublic = isPublic,
         Id = b.BoardId
     };
 }
Ejemplo n.º 4
0
 public BoardList GetBListFromBoard(Board board, string listname)
 {
     return board.Lists.FirstOrDefault(list => list.Name.Equals(listname));
 }
Ejemplo n.º 5
0
 private BoardList GetList(Board b, int id)
 {
     return b.Lists.Get(id);
 }
Ejemplo n.º 6
0
        public void RemoveCardFromBoard(Board board, int cardId, int listId)
        {
            var list = GetListFromBoard(board,listId);
            var card = GetEntryFromBoard(board, cardId);

            list.Remove(list.GetIndexFor(card));
            board.Archived.Add(card.Id,card);
        }
Ejemplo n.º 7
0
 public IndexedList<BoardCard> GetListFromBoard(Board board, int listId)
 {
     return GetListFromBoard(board)[listId];
 }
Ejemplo n.º 8
0
 public Dictionary<int, IndexedList<BoardCard>> GetListFromBoard(Board b)
 {
     return b.Lists.ToDictionary(blist => blist.Id, blist => blist.Cards);
 }
Ejemplo n.º 9
0
        //AUXILIARY METHOD
        public int GetIdOfListWhereCardIs(Board b, int cardId)
        {
            var lists = GetListFromBoard(b);

            return lists.FirstOrDefault(pair => pair.Value.Select(elements => elements.Id).Contains(cardId)).Key;
        }
Ejemplo n.º 10
0
        public BoardCard GetEntryFromBoard(Board board, int id)
        {
            BoardCard outValue;
            board.Cards.TryGetValue(id, out outValue);

            return outValue;
        }