Exemple #1
0
        private static void WriteTable(DocumentationWriter writer, IEnumerable <XElement> elements)
        {
            using (IEnumerator <XElement> en = elements.GetEnumerator())
            {
                if (en.MoveNext())
                {
                    XElement element = en.Current;

                    string name = element.Name.LocalName;

                    if (name == "listheader" &&
                        en.MoveNext())
                    {
                        int columnCount = element.Elements().Count();

                        writer.WriteStartTable(columnCount);
                        writer.WriteStartTableRow();

                        foreach (XElement element2 in element.Elements())
                        {
                            writer.WriteStartTableCell();
                            WriteContentTo(element2, writer, inlineOnly: true);
                            writer.WriteEndTableCell();
                        }

                        writer.WriteEndTableRow();
                        writer.WriteTableHeaderSeparator();

                        do
                        {
                            element = en.Current;

                            writer.WriteStartTableRow();

                            int count = 0;
                            foreach (XElement element2 in element.Elements())
                            {
                                writer.WriteStartTableCell();
                                WriteContentTo(element2, writer, inlineOnly: true);
                                writer.WriteEndTableCell();
                                count++;

                                if (count == columnCount)
                                {
                                    break;
                                }
                            }

                            while (count < columnCount)
                            {
                                writer.WriteTableCell(null);
                                count++;
                            }

                            writer.WriteEndTableRow();
                        } while (en.MoveNext());

                        writer.WriteEndTable();
                    }
                }
            }
        }