Esempio n. 1
0
        internal static CollectionWrapper GetSerializeableCollection(StringDictionary col)
        {
            if (col == null)
                return null;

            CollectionWrapper scol = new CollectionWrapper();
            foreach (String key in col.Keys)
                scol._collection.Add(key, col[key]);

            return scol;
        }
Esempio n. 2
0
        internal static CollectionWrapper GetSerializeableCollection(StringDictionary col)
        {
            if (col == null)
            {
                return(null);
            }

            CollectionWrapper scol = new CollectionWrapper();

            foreach (String key in col.Keys)
            {
                scol._collection.Add(key, col[key]);
            }

            return(scol);
        }
Esempio n. 3
0
        internal static ContentTypeWrapper GetSerializeableContentType(ContentType ct)
        {
            if (ct == null)
            {
                return(null);
            }

            ContentTypeWrapper sct = new ContentTypeWrapper();

            sct._boundary   = ct.Boundary;
            sct._charSet    = ct.CharSet;
            sct._mediaType  = ct.MediaType;
            sct._name       = ct.Name;
            sct._parameters = CollectionWrapper.GetSerializeableCollection(ct.Parameters);

            return(sct);
        }
Esempio n. 4
0
        ///
        /// Creates a new serializeable mailmessage based on a MailMessage object
        ///
        public MailMessageWrapper(MailMessage mm)
        {
            IsBodyHtml = mm.IsBodyHtml;
            Body       = mm.Body;
            Subject    = mm.Subject;
            From       = MailAddressWrapper.GetSerializeableMailAddress(mm.From);
            foreach (MailAddress ma in mm.To)
            {
                To.Add(MailAddressWrapper.GetSerializeableMailAddress(ma));
            }
            foreach (MailAddress ma in mm.CC)
            {
                CC.Add(MailAddressWrapper.GetSerializeableMailAddress(ma));
            }
            foreach (MailAddress ma in mm.Bcc)
            {
                Bcc.Add(MailAddressWrapper.GetSerializeableMailAddress(ma));
            }
            foreach (Attachment att in mm.Attachments)
            {
                Attachments.Add(AttachmentWrapper.GetSerializeableAttachment(att));
            }

            BodyEncoding = mm.BodyEncoding;

            DeliveryNotificationOptions = mm.DeliveryNotificationOptions;
            Headers  = CollectionWrapper.GetSerializeableCollection(mm.Headers);
            Priority = mm.Priority;

            foreach (MailAddress ma in mm.ReplyToList)
            {
                ReplyTo.Add(MailAddressWrapper.GetSerializeableMailAddress(ma));
            }

            Sender          = MailAddressWrapper.GetSerializeableMailAddress(mm.Sender);
            SubjectEncoding = mm.SubjectEncoding;

            foreach (AlternateView av in mm.AlternateViews)
            {
                AlternateViews.Add(AlternateViewWrapper.GetSerializeableAlternateView(av));
            }
        }
Esempio n. 5
0
    /// 
    /// Creates a new serializeable mailmessage based on a MailMessage object
    /// 
    public MailMessageWrapper(MailMessage mm)
    {
      IsBodyHtml = mm.IsBodyHtml;
      Body = mm.Body;
      Subject = mm.Subject;
      From = MailAddressWrapper.GetSerializeableMailAddress(mm.From);
      foreach (MailAddress ma in mm.To)
      {
        To.Add(MailAddressWrapper.GetSerializeableMailAddress(ma));
      }
      foreach (MailAddress ma in mm.CC)
      {
        CC.Add(MailAddressWrapper.GetSerializeableMailAddress(ma));
      }
      foreach (MailAddress ma in mm.Bcc)
      {
        Bcc.Add(MailAddressWrapper.GetSerializeableMailAddress(ma));
      }
      foreach (Attachment att in mm.Attachments)
      {
        Attachments.Add(AttachmentWrapper.GetSerializeableAttachment(att));
      }

      BodyEncoding = mm.BodyEncoding;

      DeliveryNotificationOptions = mm.DeliveryNotificationOptions;
      Headers = CollectionWrapper.GetSerializeableCollection(mm.Headers);
      Priority = mm.Priority;

      foreach (MailAddress ma in mm.ReplyToList)
      {
        ReplyTo.Add(MailAddressWrapper.GetSerializeableMailAddress(ma));
      }

      Sender = MailAddressWrapper.GetSerializeableMailAddress(mm.Sender);
      SubjectEncoding = mm.SubjectEncoding;

      foreach (AlternateView av in mm.AlternateViews)
        AlternateViews.Add(AlternateViewWrapper.GetSerializeableAlternateView(av));
    }