Example #1
0
        protected override void GenerateColumn(XElement row, ComplexNode tableRow)
        {
            int columnPosition = 0;

            for (int i = 0; i < row.Elements("col").Count() - 1; i++)
            {
                var column = row.Elements("col").ElementAt(i);
                if (i == 1)
                {
                    var geoParent = row.Elements("col").ElementAt(i - 1);

                    var countryClass = string.Empty;

                    var text = row.Elements("col").ElementAt(i).Value;
                    if (string.IsNullOrEmpty(text))
                    {
                        countryClass = " cluster";
                    }
                    else
                    {
                        countryClass = " country";
                    }

                    var cell = new GuideBodyCellLeftGrayCountryFactory("td", column.Value, geoParent.Value, columnPosition + countryClass);
                    tableRow.ChildNodes.Add(cell);
                    columnPosition++;
                }
                if (i == 5)
                {
                    var cell = new GuideBodyCellCrossBgGrayTextFactory("td", column.Value, columnPosition);
                    tableRow.ChildNodes.Add(cell);
                    columnPosition++;
                }
                else if (i == 2 || i == 3 || i == 4 || i == 5 || i == 6)
                {
                    var cell = new GuideBodyCellLeftGrayFactory("td", column.Value, columnPosition);
                    tableRow.ChildNodes.Add(cell);
                    columnPosition++;
                }
                else if (i >= 7)
                {
                    var cell = new GuideBodyCellCrossTextFactory("td", column.Value, columnPosition);
                    tableRow.ChildNodes.Add(cell);
                    columnPosition++;
                }
            }
        }
Example #2
0
        protected override void GenerateColumn(XElement row, ComplexNode tableRow)
        {
            int columnPosition = 0;

            for (int i = 0; i < row.Elements("col").Count(); i++)
            {
                var column = row.Elements("col").ElementAt(i);
                if (i >= 0 && i <= 1)
                {
                    var cell = new GuideBodyCellLeftGrayFactory("td", column.Value, columnPosition);
                    tableRow.ChildNodes.Add(cell);
                    columnPosition++;
                }
                else if (i >= 2)
                {
                    var cell = new GuideBodyCellCrossTextFactory("td", column.Value, columnPosition);
                    tableRow.ChildNodes.Add(cell);
                    columnPosition++;
                }
            }
        }