Example #1
0
 /// <summary>Add a cell to a row with a simple arrow running from left to right in the cell.</summary>
 void AddCell(int row, ZColumn col)
 {
     if (col != null)
     {
         Report.Rows[row].AddCell(new ZCell());
     }
 }
Example #2
0
        /// <summary>
        /// Add column and cells representing this game, plus an arrow showing paths leading out of this game.
        /// </summary>
        /// <param name="gameName">Title for the column.</param>
        /// <param name="topSpace">Space above this game to fill with pale horizontal arrows representing teams that haven't played their first game yet.</param>
        /// <param name="stepDown">Space above this game to fill with _dark_ horizontal arrows, representing teams that have played their first game, but aren't in this game.</param>
        /// <param name="teamsInGame">Teams that are actually playing in this game.</param>
        /// <param name="bottomSpace">Space below this game to fill with dark horizontal arrows, representing teams that have played their first game, but aren't in this game.</param>
        /// <param name="narrow">If true, add just one column, and just one columns worth of cells, with the game cells going in the column just to the left of the one we're adding. If false, add two columns, with the second being for arrows.</param>
        /// <param name="prefillArrows">If true, place simple left-right expanding arrows in the cells above the game that would otherwise be blank in this column.</param>
        /// <returns>The column that contains the game cells.</returns>
        ZColumn FillColumn(string gameName, int topSpace, int stepDown, int teamsInGame, int bottomSpace, bool narrow = false, bool prefillArrows = false)
        {
            ZColumn gameCol;

            // Add columns for game (and the arrows between games).
            if (narrow)
            {
                gameCol      = Report.Columns.Last();
                gameCol.Text = gameName;
            }
            else
            {
                gameCol = new ZColumn(gameName, ZAlignment.Center, "Games");
                Report.Columns.Add(gameCol);
            }

            var arrowCol = new ZColumn(null, ZAlignment.Center, "Games");

            Report.Columns.Add(arrowCol);
            var arrow = new Arrow();

            arrowCol.Arrows.Add(arrow);

            int row = 0;

            // Add cells for the space above this game (and the arrows between games).
            for (int i = 0; i < topSpace && row < Report.Rows.Count - teamsInGame; i++, row++)
            {
                AddCells(row, narrow ? null : gameCol, arrowCol);
                if (prefillArrows)
                {
                    gameCol.AddArrow(row, 5, Color.FromArgb(0xEE, 0xEE, 0xEE), true);
                }
            }

            // Add cells for the space which is above this game but below the teams first game, because this is a lower track.
            for (int i = 0; i < stepDown && row < Report.Rows.Count - teamsInGame; i++, row++)
            {
                AddCells(row, narrow ? null : gameCol, arrowCol);
                if (prefillArrows)
                {
                    gameCol.AddArrow(row, 5, default, true);
Example #3
0
 void AddCells(int row, ZColumn col1, ZColumn col2)
 {
     AddCell(row, col1);
     AddCell(row, col2);
 }