Esempio n. 1
0
        /// <summary>
        /// It writes a list of experiences
        /// </summary>
        /// <param name="fluentConsole"></param>
        /// <param name="experiences"></param>
        /// <returns></returns>
        public static FluentConsole Write(
            this FluentConsole fluentConsole,
            IEnumerable <Experience> experiences)
        {
            foreach (var workingExperience in experiences)
            {
                fluentConsole.Tab().Write($"· {workingExperience.Description}");

                if (workingExperience.From != null)
                {
                    fluentConsole.Write($" from {workingExperience.From.Value.Year}");
                    if (workingExperience.To != null)
                    {
                        fluentConsole.Write($" to {workingExperience.To.Value.Year}");
                    }
                }

                fluentConsole.NewLine();
            }

            return(fluentConsole);
        }
Esempio n. 2
0
        /// <summary>
        /// It writes a list of links
        /// </summary>
        /// <param name="fluentConsole"></param>
        /// <param name="links"></param>
        /// <returns></returns>
        public static FluentConsole Write(
            this FluentConsole fluentConsole,
            IEnumerable <Link> links,
            bool shouldShowUrls)
        {
            var whatToWrite = new List <string>();

            foreach (var link in links.OrderBy(l => l.Title))
            {
                var text = link.Title;

                if (shouldShowUrls)
                {
                    text = $"{text} \t{link.Url}";
                }

                whatToWrite.Add(text);
            }

            fluentConsole.Write(whatToWrite);
            return(fluentConsole);
        }