コード例 #1
0
        private void AddSectionContent(Sections sections)
        {
            sections.AddSection("file")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla");

            sections.AddSection("project")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla");

            sections.AddSection("extension")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla");

            sections.AddSection("beautiful-window")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla");

            sections.AddSection("analyze")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla")
            .AddLine("bla bla bla bla bla bla bla bla bla bla bla bla bla");
        }
コード例 #2
0
        private void MergeSection(section otherSection)
        {
            if (!Sections.ContainsSection(otherSection.SectionName))
            {
                Sections.AddSection(otherSection.SectionName);
            }

            Sections.GetSectionData(otherSection.SectionName).Merge(otherSection);
        }
コード例 #3
0
ファイル: IniData.cs プロジェクト: YSCHGroup/KleskBY-base
        /// <summary>
        ///     Merge the sections into this by overwriting this sections.
        /// </summary>
        private void MergeSection(SectionData otherSection)
        {
            // no overlap -> create no section
            if (!Sections.ContainsSection(otherSection.SectionName))
            {
                Sections.AddSection(otherSection.SectionName);
            }

            // merge section into the new one
            Sections.GetSectionData(otherSection.SectionName).Merge(otherSection);
        }
コード例 #4
0
ファイル: DdlParser.cs プロジェクト: Sl0vi/MigraDoc
        /// <summary>
        /// Parses the keyword «\section».
        /// </summary>
        private Section ParseSection(Sections sections)
        {
            Debug.Assert(sections != null);

            MoveToCode();
            AssertSymbol(Symbol.Section);

            Section section = null;
            try
            {
                section = sections.AddSection();

                ReadCode(); // read '[' or '{'
                if (Symbol == Symbol.BracketLeft)
                    ParseAttributes(section);

                AssertSymbol(Symbol.BraceLeft);

                // Consider the case that the keyword «\paragraph» can be omitted.
                if (IsParagraphContent())
                {
                    Paragraph paragraph = section.Elements.AddParagraph();
                    ParseParagraphContent(section.Elements, paragraph);
                }
                else
                {
                    ReadCode(); // read beyond '{'

                    // 1st parse headers and footers
                    while (IsHeaderFooter())
                        ParseHeaderFooter(section);

                    // 2nd parse all other stuff
                    ParseDocumentElements(section.Elements, Symbol.Section);
                }
                AssertSymbol(Symbol.BraceRight);
                ReadCode(); // read beyond '}'
            }
            catch (DdlParserException ex)
            {
                ReportParserException(ex);
                AdjustToNextBlock();
            }
            return section;
        }