public string GetSection()
        {
            if (Sections == null || Sections.Length == 0)
            {
                return(null);
            }

            if (Sections.Length == 1)
            {
                return(Sections[0]);
            }

            return(Sections.Aggregate((x, y) => x + ":" + y));
        }
示例#2
0
        public void Save(string folder)
        {
            if (!folder.EndsWith("\\"))
            {
                folder = folder + "\\";
            }

            //ahora construyo el string
            var code = Sections.Aggregate("", (current, sec) => current + sec.WriteCode());

            code += GetEndCode();
            var file = new StreamWriter(folder + Name);

            file.Write(code);
            file.Close();
        }
 /// <summary>
 /// Gets a textual representation of the grid model - eg. to be used in Examine.
 /// </summary>
 /// <returns>Returns an instance of <see cref="System.String"/> representing the value of the grid model.</returns>
 public virtual string GetSearchableText()
 {
     return(Sections.Aggregate("", (current, section) => current + section.GetSearchableText()));
 }
示例#4
0
 /// <summary>
 /// Returns the pages contained in the notebook which satisfy a given check function.
 /// </summary>
 /// <param name="check">A conditional predicate for a Page object.</param>
 /// <returns>A list of pages for which the function returns true.</returns>
 public List <Page> GetPagesWhere(Func <Page, bool> check) => Sections.Aggregate(new List <Page>(), (list, section) => list.Concat(section.Pages.Where(check)).ToList());