private void LoadCards(Lane lane, ToolTip globalToolTip) { var cardDocuments = _cardDatabaseService.Get(lane.Id); //TODO: Build cards and add them to lane foreach (var cardDocument in cardDocuments) { CardTypes.TryParse(cardDocument.CardType, true, out CardTypes resultingCardType); //Next line needed to reflect true card type. var card = new Card(cardDocument.ParentLaneId, cardDocument.CardName, cardDocument.CardDescription, cardDocument.CardPoints, cardDocument.Id, GlobalToolTip, resultingCardType); lane.AddCard(card); } }
public void LoadLane(LaneDocument laneDocument) { var lane = new Lane(laneDocument.Title, _cardDatabaseService, GlobalToolTip, laneDocument.ProjectId) { Height = this.Height - 20, Id = laneDocument.Id }; lane.LaneRequestingTitleChanged += LaneLaneRequestingTitleChanged; lane.LaneRequestingDelete += Lane_LaneRequestingDelete; lane.LaneRequestingAddLane += Lane_LaneRequestingAddLane; lane.LaneRequestingAddCard += Lane_LaneRequestingAddCard; lane.LaneRequestingEditCardLane += Lane_LaneRequestingEditCardLane; LanesCollection.Add(lane); _layoutPanel.Controls.Add(lane); LoadCards(lane, GlobalToolTip); lane.Focus(); }
public void AddLane(int projectId, string projectName, string laneLabel) { var lane = new Lane(laneLabel, _cardDatabaseService, GlobalToolTip, projectId) { Height = this.Height - 20 }; lane.LaneRequestingTitleChanged += LaneLaneRequestingTitleChanged; lane.LaneRequestingDelete += Lane_LaneRequestingDelete; lane.LaneRequestingAddLane += Lane_LaneRequestingAddLane; lane.LaneRequestingAddCard += Lane_LaneRequestingAddCard; lane.LaneRequestingEditCardLane += Lane_LaneRequestingEditCardLane; lane.Id = _lanesDatabaseService.Insert(laneLabel, projectId); LanesCollection.Add(lane); _layoutPanel.Controls.Add(lane); lane.Focus(); }
public void LoadLanes(int projectId, string projectName) { var lanesCollection = _lanesDatabaseService.GetAll(projectId); foreach (var laneDocument in lanesCollection) { //TODO refactor duplicated code . var lane = new Lane(laneDocument.Title, _cardDatabaseService, GlobalToolTip, projectId) { Height = this.Height - 60, Id = laneDocument.Id }; lane.LaneRequestingTitleChanged += LaneLaneRequestingTitleChanged; lane.LaneRequestingDelete += Lane_LaneRequestingDelete; lane.LaneRequestingAddLane += Lane_LaneRequestingAddLane; lane.LaneRequestingAddCard += Lane_LaneRequestingAddCard; lane.LaneRequestingEditCardLane += Lane_LaneRequestingEditCardLane; LanesCollection.Add(lane); LoadCards(lane, GlobalToolTip); _layoutPanel.Controls.Add(lane); } }