readFile() private method

private readFile ( string filePath ) : byte[]
filePath string
return byte[]
Exemplo n.º 1
0
 /// <summary>
 /// This will populate the checklist points lists
 /// by loop through all checklists and finding associated
 /// points to each checklist
 /// </summary>
 private void populatePoints()
 {
     foreach (Checklist checklist in checklists)
     {
         points.AddRange(pointJson.readFile <ChecklistPoint>().FindAll(x => x.checklistId == checklist.id));
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// This will populate the cards list
        /// by looping through each list and finding associated
        /// cards to each list.
        /// </summary>
        private void populateCards()
        {
            foreach (List list in lists)
            {
                cards.AddRange(cardJson.readFile <Card>().FindAll(x => x.listId == list.id));
            }

            populateChecklistsAndComments();
        }
Exemplo n.º 3
0
        /// <summary>
        /// This will populate both checklists and comments lists
        /// by looping through each card and finding associated
        /// checklists and comments to each card.
        /// </summary>
        private void populateChecklistsAndComments()
        {
            foreach (Card card in cards)
            {
                checklists.AddRange(checkJson.readFile <Checklist>().FindAll(x => x.cardId == card.id));
                comments.AddRange(commentJson.readFile <Comment>().FindAll(x => x.cardId == card.id));
            }

            populatePoints();
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initialize the controller with a board id,
        /// to autmatically populate lists, cards, checklists etc.
        /// </summary>
        /// <param name="boardId">The ID of the board to initialize this controller for.</param>
        public BoardController(string boardId)
        {
            id = boardId;
            iniJsonAndLists();

            Board b = boardJson.readFile <Board>().Find(x => x.id == id);

            name    = b.name;
            created = b.created;

            // Start a chain-reaction and populte all our lists
            populateLists();
        }
Exemplo n.º 5
0
        /// <summary>
        /// This will initialize the required models for this controller.
        /// </summary>
        private void iniModels()
        {
            cardJson = new Json(cardJsonFile);
            cards    = cardJson.readFile <Card>();

            commentJson = new Json(commentJsonFile);
            comments    = commentJson.readFile <Comment>();

            checklistJson = new Json(checklistJsonFile);
            checklists    = checklistJson.readFile <Checklist>();

            pointJson = new Json(pointJsonFile);
            points    = pointJson.readFile <ChecklistPoint>();
        }
Exemplo n.º 6
0
 /// <summary>
 /// Constructor.
 /// Reads all the boards and initialises a json model
 /// </summary>
 public OverviewController()
 {
     json   = new Json(jsonFile);
     boards = json.readFile <Board>().Where(x => x.active).ToList();
 }
Exemplo n.º 7
0
 /// <summary>
 /// This will populate the lists list
 /// by finding all lists associated to the board id.
 /// </summary>
 private void populateLists()
 {
     lists = listJson.readFile <List>().FindAll(x => x.boardId == id);
     populateCards();
 }
Exemplo n.º 8
0
 public ListController(string boardId)
 {
     this.boardId = boardId;
     json         = new Json(jsonFile);
     lists        = json.readFile <List>().Where(x => x.active == true).ToList();
 }