d04a59a88f0538cce978a18cdf07e7d76ef63af1
[mono.git] / mcs / class / System.Web / System.Web.Mail / MailMessageWrapper.cs
1 // MailMessageWrapper.cs
2 // author: Per Arneng <pt99par@student.bth.se>
3 using System;
4 using System.Collections;
5 using System.Text;
6
7 namespace System.Web.Mail {
8
9     internal class MailMessageWrapper {
10                 
11         private MailAddressCollection bcc = new MailAddressCollection();
12         private MailAddressCollection cc = new MailAddressCollection();         
13         private MailAddress from;
14         private MailAddressCollection to = new MailAddressCollection();
15         private MailMessage message;
16                 
17         // Constructor          
18         public MailMessageWrapper( MailMessage message )
19         {
20             this.message = message;
21             
22             if(message.From != null ) from = MailAddress.Parse( message.From );
23             if(message.To != null ) to = MailAddressCollection.Parse( message.To );
24             if(message.Cc != null )cc = MailAddressCollection.Parse( message.Cc );
25             if(message.Bcc != null )bcc = MailAddressCollection.Parse( message.Bcc );
26         }               
27         
28         // Properties
29         public IList Attachments {
30             get { return message.Attachments; }
31         }               
32                 
33         public MailAddressCollection Bcc {
34             get { return bcc; } 
35         }
36         
37         public string Body {
38             get { return message.Body; } 
39             set { message.Body = value; } 
40         }
41
42         public Encoding BodyEncoding {
43             get { return message.BodyEncoding; } 
44             set { message.BodyEncoding = value; }
45         }
46
47         public MailFormat BodyFormat {
48             get { return message.BodyFormat; } 
49             set { message.BodyFormat = value; }
50         }               
51
52         public MailAddressCollection Cc {
53             get { return cc; } 
54         }
55
56         public MailAddress From {
57             get { return from; } 
58         }
59
60         public IDictionary Headers {
61             get { return message.Headers; }
62         }
63                 
64         public MailPriority Priority {
65             get { return message.Priority; } 
66             set { message.Priority = value; }
67         }
68                 
69         public string Subject {
70             get { return message.Subject; } 
71             set { message.Subject = value; }
72         }
73
74         public MailAddressCollection To {
75             get { return to; }   
76         }
77
78         public string UrlContentBase {
79             get { return message.UrlContentBase; } 
80             
81         }
82
83         public string UrlContentLocation {
84             get { return message.UrlContentLocation; } 
85         }
86     }
87
88 }