org.GraphDefined.Vanaheimr.Hermod.Mail.EMailBodypart.ToText C# (CSharp) Method

ToText() public method

public ToText ( System.Boolean IncludeHeaders = true ) : IEnumerable
IncludeHeaders System.Boolean
return IEnumerable
        public IEnumerable<String> ToText(Boolean IncludeHeaders = true)
        {
            var AllHeaders = (IncludeHeaders
                                 ? MailHeaders.
                                       Select(v => v.Key + ": " + v.Value).
                                       Concat(new String[] { "" })
                                 : new String[0]).

                             Concat(_MailBody != null ? _MailBody : (IEnumerable<String>) new String[0]).

                             Concat(_NestedBodyparts.
                                        SelectMany(bodypart => new String[] { "--" + ContentType.MIMEBoundary }.
                                        Concat(bodypart.ToText(true)))).

                             Concat(_NestedBodyparts.Count() > 0 ? new String[] { "--" + ContentType.MIMEBoundary + "--" } : new String[0]);

            return AllHeaders;
        }