diff options
author | Gert Driesen <drieseng@users.sourceforge.net> | 2005-09-15 20:53:38 +0400 |
---|---|---|
committer | Gert Driesen <drieseng@users.sourceforge.net> | 2005-09-15 20:53:38 +0400 |
commit | 08ac020979eaebb40a6b166b1a384d0446d81fd9 (patch) | |
tree | 969a40e2840f131c74aeb62b4f5fcedf38b9c2c6 /mcs/class/System.Web/System.Web.Mail | |
parent | ea15b3dca210a9b41ebfc5e315e546f7ddeb2281 (diff) |
* MailPriority.cs: Marked obsolete in 2.0 profile. Fixed line endings.
* SmtpMail.cs: Added workaround message to ensure same warning is
generated as MS.NET 2.0.
* MailMessage.cs: same and fixed line endings. Set eol-style to native.
* MailEncoding.cs: same.
* MailFormat.cs: same.
* MailAttachment.cs: same.
svn path=/trunk/mcs/; revision=50090
Diffstat (limited to 'mcs/class/System.Web/System.Web.Mail')
-rw-r--r-- | mcs/class/System.Web/System.Web.Mail/ChangeLog | 10 | ||||
-rw-r--r-- | mcs/class/System.Web/System.Web.Mail/MailAttachment.cs | 78 | ||||
-rw-r--r-- | mcs/class/System.Web/System.Web.Mail/MailEncoding.cs | 28 | ||||
-rw-r--r-- | mcs/class/System.Web/System.Web.Mail/MailFormat.cs | 26 | ||||
-rw-r--r-- | mcs/class/System.Web/System.Web.Mail/MailMessage.cs | 218 | ||||
-rw-r--r-- | mcs/class/System.Web/System.Web.Mail/MailPriority.cs | 30 | ||||
-rw-r--r-- | mcs/class/System.Web/System.Web.Mail/SmtpMail.cs | 4 |
7 files changed, 203 insertions, 191 deletions
diff --git a/mcs/class/System.Web/System.Web.Mail/ChangeLog b/mcs/class/System.Web/System.Web.Mail/ChangeLog index fd4bff5348d..3558f6187bf 100644 --- a/mcs/class/System.Web/System.Web.Mail/ChangeLog +++ b/mcs/class/System.Web/System.Web.Mail/ChangeLog @@ -1,3 +1,13 @@ +2005-09-15 Gert Driesen <drieseng@users.sourceforge.net> + + * MailPriority.cs: Marked obsolete in 2.0 profile. Fixed line endings. + * SmtpMail.cs: Added workaround message to ensure same warning is + generated as MS.NET 2.0. + * MailMessage.cs: same and fixed line endings. Set eol-style to native. + * MailEncoding.cs: same. + * MailFormat.cs: same. + * MailAttachment.cs: same. + 2005-09-13 Sebastien Pouliot <sebastien@ximian.com> * SmtpMail.cs: Added an Assert for FileIOPermission so it's possible diff --git a/mcs/class/System.Web/System.Web.Mail/MailAttachment.cs b/mcs/class/System.Web/System.Web.Mail/MailAttachment.cs index 453ed2cd042..809524b6fd3 100644 --- a/mcs/class/System.Web/System.Web.Mail/MailAttachment.cs +++ b/mcs/class/System.Web/System.Web.Mail/MailAttachment.cs @@ -1,11 +1,11 @@ -//
-// System.Web.Mail.MailAttachment.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
+// +// System.Web.Mail.MailAttachment.cs +// +// Author: +// Lawrence Pit (loz@cable.a2000.nl) // Per Arneng (pt99par@student.bth.se) -// Sebastien Pouliot <sebastien@ximian.com>
-//
+// Sebastien Pouliot <sebastien@ximian.com> +// // Copyright (C) 2005 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining @@ -31,26 +31,26 @@ using System.IO; using System.Security; using System.Security.Permissions; -
-namespace System.Web.Mail
-{
+ +namespace System.Web.Mail +{ // CAS [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] #if NET_2_0 - [Obsolete] + [Obsolete ("The recommended alternative is System.Net.Mail.Attachment.")] #endif - public class MailAttachment
- {
- private string filename;
- private MailEncoding encoding;
-
- public MailAttachment (string filename) :
- this (filename, MailEncoding.Base64)
- {
- }
-
- public MailAttachment (string filename, MailEncoding encoding)
+ public class MailAttachment + { + private string filename; + private MailEncoding encoding; + + public MailAttachment (string filename) : + this (filename, MailEncoding.Base64) + { + } + + public MailAttachment (string filename, MailEncoding encoding) { if (SecurityManager.SecurityEnabled) { new FileIOPermission (FileIOPermissionAccess.Read, filename).Demand (); @@ -58,22 +58,22 @@ namespace System.Web.Mail if (!File.Exists (filename)) { string msg = Locale.GetText ("Cannot find file: '{0}'."); - throw new HttpException (String.Format (msg, filename));
+ throw new HttpException (String.Format (msg, filename)); } -
- this.filename = filename;
+ + this.filename = filename; this.encoding = encoding; - }
-
- // Properties
- public string Filename
- {
- get { return filename; }
- }
-
- public MailEncoding Encoding
- {
- get { return encoding; }
- }
- }
-}
+ } + + // Properties + public string Filename + { + get { return filename; } + } + + public MailEncoding Encoding + { + get { return encoding; } + } + } +} diff --git a/mcs/class/System.Web/System.Web.Mail/MailEncoding.cs b/mcs/class/System.Web/System.Web.Mail/MailEncoding.cs index 34eea8261b6..d38de363f45 100644 --- a/mcs/class/System.Web/System.Web.Mail/MailEncoding.cs +++ b/mcs/class/System.Web/System.Web.Mail/MailEncoding.cs @@ -1,9 +1,9 @@ -//
-// System.Web.Mail.MailEncoding.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
+// +// System.Web.Mail.MailEncoding.cs +// +// Author: +// Lawrence Pit (loz@cable.a2000.nl) +// // Copyright (C) 2005 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining @@ -25,14 +25,14 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -
+ namespace System.Web.Mail { -
+ #if NET_2_0 - [Obsolete] + [Obsolete ("The recommended alternative is System.Net.Mime.TransferEncoding.")] #endif - public enum MailEncoding {
- UUEncode,
- Base64
- }
-}
+ public enum MailEncoding { + UUEncode, + Base64 + } +} diff --git a/mcs/class/System.Web/System.Web.Mail/MailFormat.cs b/mcs/class/System.Web/System.Web.Mail/MailFormat.cs index 0fa0d399429..a9a282d8cb7 100644 --- a/mcs/class/System.Web/System.Web.Mail/MailFormat.cs +++ b/mcs/class/System.Web/System.Web.Mail/MailFormat.cs @@ -1,9 +1,9 @@ -//
-// System.Web.Mail.MailFormat.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
+// +// System.Web.Mail.MailFormat.cs +// +// Author: +// Lawrence Pit (loz@cable.a2000.nl) +// // Copyright (C) 2005 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining @@ -25,14 +25,14 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -
+ namespace System.Web.Mail { -
+ #if NET_2_0 - [Obsolete] + [Obsolete ("The recommended alternative is System.Net.Mail.MailMessage.IsBodyHtml.")] #endif - public enum MailFormat {
- Text,
- Html
- }
+ public enum MailFormat { + Text, + Html + } } diff --git a/mcs/class/System.Web/System.Web.Mail/MailMessage.cs b/mcs/class/System.Web/System.Web.Mail/MailMessage.cs index e91dd0e3426..144903ba282 100644 --- a/mcs/class/System.Web/System.Web.Mail/MailMessage.cs +++ b/mcs/class/System.Web/System.Web.Mail/MailMessage.cs @@ -1,9 +1,9 @@ -//
-// System.Web.Mail.MailMessage.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-// Per Arneng (pt99par@student.bth.se)
+// +// System.Web.Mail.MailMessage.cs +// +// Author: +// Lawrence Pit (loz@cable.a2000.nl) +// Per Arneng (pt99par@student.bth.se) // Sanjay Gupta (gsanjay@novell.com) // // Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com) @@ -27,119 +27,119 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -
-using System.Collections;
-using System.Collections.Specialized;
+ +using System.Collections; +using System.Collections.Specialized; using System.Security.Permissions; -using System.Text;
-
-namespace System.Web.Mail
-{
+using System.Text; + +namespace System.Web.Mail +{ // CAS [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] #if NET_2_0 - [Obsolete] + [Obsolete ("The recommended alternative is System.Net.Mail.MailMessage.")] #endif - public class MailMessage
- {
- private ArrayList attachments;
- private string bcc;
- private string body = String.Empty;
- private Encoding bodyEncoding;
- private MailFormat bodyFormat;
- private string cc;
- private string from;
- private ListDictionary headers;
- private MailPriority priority;
- private string subject = String.Empty;
- private string to;
- private string urlContentBase;
+ public class MailMessage + { + private ArrayList attachments; + private string bcc; + private string body = String.Empty; + private Encoding bodyEncoding; + private MailFormat bodyFormat; + private string cc; + private string from; + private ListDictionary headers; + private MailPriority priority; + private string subject = String.Empty; + private string to; + private string urlContentBase; private string urlContentLocation; -
- // Constructor
- public MailMessage ()
- {
- attachments = new ArrayList (8);
- headers = new ListDictionary ();
+ + // Constructor + public MailMessage () + { + attachments = new ArrayList (8); + headers = new ListDictionary (); bodyEncoding = Encoding.Default; #if NET_1_1 - fields = new Hashtable ();
+ fields = new Hashtable (); #endif - }
-
- // Properties
- public IList Attachments {
- get { return (IList) attachments; }
- }
-
- public string Bcc {
- get { return bcc; }
- set { bcc = value; }
- }
-
- public string Body {
- get { return body; }
- set { body = value; }
- }
-
- public Encoding BodyEncoding {
- get { return bodyEncoding; }
- set { bodyEncoding = value; }
- }
-
- public MailFormat BodyFormat {
- get { return bodyFormat; }
- set { bodyFormat = value; }
- }
-
- public string Cc {
- get { return cc; }
- set { cc = value; }
- }
-
- public string From {
- get { return from; }
- set { from = value; }
- }
-
- public IDictionary Headers {
- get { return (IDictionary) headers; }
- }
-
- public MailPriority Priority {
- get { return priority; }
- set { priority = value; }
- }
-
- public string Subject {
- get { return subject; }
- set { subject = value; }
- }
-
- public string To {
- get { return to; }
- set { to = value; }
- }
-
- public string UrlContentBase {
- get { return urlContentBase; }
- set { urlContentBase = value; }
- }
-
- public string UrlContentLocation {
- get { return urlContentLocation; }
- set { urlContentLocation = value; }
- }
-
-#if NET_1_1
- private Hashtable fields;
+ } + + // Properties + public IList Attachments { + get { return (IList) attachments; } + } + + public string Bcc { + get { return bcc; } + set { bcc = value; } + } + + public string Body { + get { return body; } + set { body = value; } + } + + public Encoding BodyEncoding { + get { return bodyEncoding; } + set { bodyEncoding = value; } + } + + public MailFormat BodyFormat { + get { return bodyFormat; } + set { bodyFormat = value; } + } + + public string Cc { + get { return cc; } + set { cc = value; } + } + + public string From { + get { return from; } + set { from = value; } + } + + public IDictionary Headers { + get { return (IDictionary) headers; } + } - public IDictionary Fields {
+ public MailPriority Priority { + get { return priority; } + set { priority = value; } + } + + public string Subject { + get { return subject; } + set { subject = value; } + } + + public string To { + get { return to; } + set { to = value; } + } + + public string UrlContentBase { + get { return urlContentBase; } + set { urlContentBase = value; } + } + + public string UrlContentLocation { + get { return urlContentLocation; } + set { urlContentLocation = value; } + } + +#if NET_1_1 + private Hashtable fields; + + public IDictionary Fields { get { return (IDictionary) fields; - }
- }
-#endif
- }
-}
+ } + } +#endif + } +} diff --git a/mcs/class/System.Web/System.Web.Mail/MailPriority.cs b/mcs/class/System.Web/System.Web.Mail/MailPriority.cs index cb55649a18c..8917be0fae2 100644 --- a/mcs/class/System.Web/System.Web.Mail/MailPriority.cs +++ b/mcs/class/System.Web/System.Web.Mail/MailPriority.cs @@ -1,9 +1,9 @@ -//
-// System.Web.Mail.MailPriority.cs
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
+// +// System.Web.Mail.MailPriority.cs +// +// Author: +// Lawrence Pit (loz@cable.a2000.nl) +// // Copyright (C) 2005 Novell, Inc (http://www.novell.com) // // Permission is hereby granted, free of charge, to any person obtaining @@ -25,12 +25,14 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -
-namespace System.Web.Mail {
- public enum MailPriority {
- Normal,
- Low,
- High
- }
-}
+namespace System.Web.Mail { +#if NET_2_0 + [Obsolete ("The recommended alternative is System.Net.Mail.MailPriority.")] +#endif + public enum MailPriority { + Normal, + Low, + High + } +} diff --git a/mcs/class/System.Web/System.Web.Mail/SmtpMail.cs b/mcs/class/System.Web/System.Web.Mail/SmtpMail.cs index d2774c0ca80..7e6042c0268 100644 --- a/mcs/class/System.Web/System.Web.Mail/SmtpMail.cs +++ b/mcs/class/System.Web/System.Web.Mail/SmtpMail.cs @@ -40,9 +40,9 @@ namespace System.Web.Mail [AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] #if NET_2_0 - [Obsolete] + [Obsolete ("The recommended alternative is System.Net.Mail.SmtpClient.")] #endif - public class SmtpMail + public class SmtpMail { private static string smtpServer = "localhost"; |