Alpinely.TownCrier.SerializableEntities.SerializeableCollection.SetColletion C# (CSharp) Method

SetColletion() private method

private SetColletion ( NameValueCollection scol ) : void
scol System.Collections.Specialized.NameValueCollection
return void
        internal void SetColletion(NameValueCollection scol)
        {
            foreach (String key in Collection.Keys)
            {
                scol.Add(key, Collection[key]);
            }
        }

Same methods

SerializeableCollection::SetColletion ( StringDictionary scol ) : void

Usage Example

        ///
        /// Returns the MailMessge object from the serializeable object
        ///
        ///
        public MailMessage GetMailMessage()
        {
            var mailMessage = new MailMessage();

            mailMessage.IsBodyHtml = IsBodyHtml;
            mailMessage.Body       = Body;
            mailMessage.Subject    = Subject;
            if (From != null)
            {
                mailMessage.From = From.GetMailAddress();
            }

            foreach (var mailAddress in _to)
            {
                mailMessage.To.Add(mailAddress.GetMailAddress());
            }

            foreach (var mailAddress in _cc)
            {
                mailMessage.CC.Add(mailAddress.GetMailAddress());
            }

            foreach (var mailAddress in _bcc)
            {
                mailMessage.Bcc.Add(mailAddress.GetMailAddress());
            }

            foreach (var attachment in _attachments)
            {
                mailMessage.Attachments.Add(attachment.GetAttachment());
            }

            mailMessage.BodyEncoding = _bodyEncoding;

            mailMessage.DeliveryNotificationOptions = _deliveryNotificationOptions;
            _headers.SetColletion(mailMessage.Headers);
            mailMessage.Priority = _priority;
            if (ReplyTo != null)
            {
                foreach (SerializeableMailAddress address in ReplyTo)
                {
                    mailMessage.ReplyToList.Add(address.GetMailAddress());
                }
            }

            if (Sender != null)
            {
                mailMessage.Sender = Sender.GetMailAddress();
            }

            mailMessage.SubjectEncoding = _subjectEncoding;

            foreach (var alternateView in _alternateViews)
            {
                mailMessage.AlternateViews.Add(alternateView.GetAlternateView());
            }

            return(mailMessage);
        }
All Usage Examples Of Alpinely.TownCrier.SerializableEntities.SerializeableCollection::SetColletion