Author: arina
Date: 2007-12-04 03:49:11 -0500 (Tue, 04 Dec 2007)
New Revision: 90625

Modified:
   trunk/mcs/class/System/ChangeLog
   trunk/mcs/class/System/System.ComponentModel.Design/HelpKeywordAttribute.cs
   trunk/mcs/class/System/System.ComponentModel/WarningException.cs
   trunk/mcs/class/System/System.Net.Mail/SmtpException.cs
   trunk/mcs/class/System/System.Net.Mail/SmtpFailedRecipientException.cs
   trunk/mcs/class/System/System.Net.Mail/SmtpFailedRecipientsException.cs
Log:
Changes for SOAP serialization compatibility with .NET 

Modified: trunk/mcs/class/System/ChangeLog
===================================================================
--- trunk/mcs/class/System/ChangeLog    2007-12-04 08:24:50 UTC (rev 90624)
+++ trunk/mcs/class/System/ChangeLog    2007-12-04 08:49:11 UTC (rev 90625)
@@ -1,3 +1,10 @@
+2007-12-04  Arina Itkes <[EMAIL PROTECTED]>
+
+       * HelpKeywordAttribute.cs, WarningException.cs,
+         SmtpException.cs, SmtpFailedRecipientException.cs,
+         SmtpFailedRecipientsException.cs: 
+         Changes for SOAP serialization compatibility with .NET. 
+
 2007-11-12  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * System.dll.sources : added S.R.InteropSvcs.ComTypes types.

Modified: trunk/mcs/class/System/System.ComponentModel/WarningException.cs
===================================================================
--- trunk/mcs/class/System/System.ComponentModel/WarningException.cs    
2007-12-04 08:24:50 UTC (rev 90624)
+++ trunk/mcs/class/System/System.ComponentModel/WarningException.cs    
2007-12-04 08:49:11 UTC (rev 90625)
@@ -72,8 +72,15 @@
                protected WarningException (SerializationInfo info, 
StreamingContext context)
                        : base (info, context)
                {
-                       helpTopic = info.GetString ("HelpTopic");
-                       helpUrl = info.GetString ("HelpUrl");
+                       try {
+                               helpTopic = info.GetString ("helpTopic");
+                               helpUrl = info.GetString ("helpUrl");
+                       }
+                       catch (SerializationException) {
+                               //For compliance with previously serialized 
version:
+                               helpTopic = info.GetString ("HelpTopic");
+                               helpUrl = info.GetString ("HelpUrl");
+                       }
                }
 
                [SecurityPermission (SecurityAction.Demand, 
SerializationFormatter = true)]
@@ -82,9 +89,9 @@
                        if (info == null)
                                throw new ArgumentNullException ("info");
 
-                       info.AddValue ("HelpTopic", helpTopic);
-                       info.AddValue ("HelpUrl", helpUrl);
                        base.GetObjectData (info, context);
+                       info.AddValue ("helpTopic", helpTopic);
+                       info.AddValue ("helpUrl", helpUrl);
                }
 #endif
 

Modified: 
trunk/mcs/class/System/System.ComponentModel.Design/HelpKeywordAttribute.cs
===================================================================
--- trunk/mcs/class/System/System.ComponentModel.Design/HelpKeywordAttribute.cs 
2007-12-04 08:24:50 UTC (rev 90624)
+++ trunk/mcs/class/System/System.ComponentModel.Design/HelpKeywordAttribute.cs 
2007-12-04 08:49:11 UTC (rev 90625)
@@ -36,7 +36,7 @@
 
                public static readonly HelpKeywordAttribute Default = null;
 
-               string keyword;
+               string contextKeyword;
                
                public HelpKeywordAttribute ()
                {
@@ -44,14 +44,14 @@
 
                public HelpKeywordAttribute (string keyword)
                {
-                       this.keyword = keyword;
+                       this.contextKeyword = keyword;
                }
 
                public HelpKeywordAttribute (Type t)
                {
                        if (t == null)
                                throw new ArgumentNullException ("t");
-                       this.keyword = t.FullName;
+                       this.contextKeyword = t.FullName;
                }
 
                public override bool Equals (object other)
@@ -63,22 +63,22 @@
                        if (o == null)
                                return false;
                        
-                       return (o.keyword == keyword);
+                       return (o.contextKeyword == contextKeyword);
                }
 
                public override int GetHashCode ()
                {
-                       return keyword != null ? keyword.GetHashCode () : 0;
+                       return contextKeyword != null ? 
contextKeyword.GetHashCode () : 0;
                }
 
                public override bool IsDefaultAttribute ()
                {
-                       return keyword == null;
+                       return contextKeyword == null;
                }
 
                public string HelpKeyword {
                        get {
-                               return keyword;
+                               return contextKeyword;
                        }
                }
        }

Modified: trunk/mcs/class/System/System.Net.Mail/SmtpException.cs
===================================================================
--- trunk/mcs/class/System/System.Net.Mail/SmtpException.cs     2007-12-04 
08:24:50 UTC (rev 90624)
+++ trunk/mcs/class/System/System.Net.Mail/SmtpException.cs     2007-12-04 
08:49:11 UTC (rev 90625)
@@ -45,8 +45,9 @@
                #region Constructors
 
                public SmtpException ()
-                       : this ("SMTP error occured")
+                       : this ("Syntax error, command unrecognized.")
                {
+                       statusCode = SmtpStatusCode.GeneralFailure;
                }
 
                public SmtpException (SmtpStatusCode statusCode)
@@ -58,6 +59,7 @@
                public SmtpException (string message)
                        : base (message)
                {
+                       statusCode = SmtpStatusCode.GeneralFailure;
                }
 
                protected SmtpException (SerializationInfo info, 
StreamingContext context)
@@ -65,7 +67,13 @@
                {
                        if (info == null)
                                throw new ArgumentNullException ("info");
-                       StatusCode = (SmtpStatusCode) info.GetValue 
("statusCode", typeof (SmtpStatusCode));
+                       try {
+                               statusCode = (SmtpStatusCode) info.GetValue 
("Status", typeof (int));
+                       }
+                       catch (SerializationException) {
+                               //For compliance with previously serialized 
version:
+                               statusCode = (SmtpStatusCode) info.GetValue 
("statusCode", typeof (SmtpStatusCode));
+                       }
                }
 
                public SmtpException (SmtpStatusCode statusCode, string message)
@@ -94,7 +102,8 @@
                {
                        if (info == null)
                                throw new ArgumentNullException ("info");
-                       info.AddValue ("statusCode", statusCode, typeof 
(SmtpStatusCode));
+                       base.GetObjectData (info, context);
+                       info.AddValue ("Status", statusCode, typeof (int));
                }
 #if !TARGET_JVM //remove private implementation
                void ISerializable.GetObjectData (SerializationInfo info, 
StreamingContext context)

Modified: trunk/mcs/class/System/System.Net.Mail/SmtpFailedRecipientException.cs
===================================================================
--- trunk/mcs/class/System/System.Net.Mail/SmtpFailedRecipientException.cs      
2007-12-04 08:24:50 UTC (rev 90624)
+++ trunk/mcs/class/System/System.Net.Mail/SmtpFailedRecipientException.cs      
2007-12-04 08:49:11 UTC (rev 90625)
@@ -55,6 +55,7 @@
                }
 
                protected SmtpFailedRecipientException (SerializationInfo 
serializationInfo, StreamingContext streamingContext)
+                       : base (serializationInfo, streamingContext)
                {
                        if (serializationInfo == null)
                                throw new ArgumentNullException 
("serializationInfo");
@@ -96,6 +97,7 @@
                {
                        if (serializationInfo == null)
                                throw new ArgumentNullException 
("serializationInfo");
+                       base.GetObjectData (serializationInfo, 
streamingContext);
                        serializationInfo.AddValue ("failedRecipient", 
failedRecipient);
                }
 #if !TARGET_JVM //remove private implementation

Modified: 
trunk/mcs/class/System/System.Net.Mail/SmtpFailedRecipientsException.cs
===================================================================
--- trunk/mcs/class/System/System.Net.Mail/SmtpFailedRecipientsException.cs     
2007-12-04 08:24:50 UTC (rev 90624)
+++ trunk/mcs/class/System/System.Net.Mail/SmtpFailedRecipientsException.cs     
2007-12-04 08:49:11 UTC (rev 90625)
@@ -63,6 +63,7 @@
                }
 
                protected SmtpFailedRecipientsException (SerializationInfo 
info, StreamingContext context)
+               : base(info, context)
                {
                        if (info == null)
                                throw new ArgumentNullException ("info");
@@ -85,6 +86,7 @@
                {
                        if (info == null)
                                throw new ArgumentNullException ("info");
+                       base.GetObjectData (info, context);
                        info.AddValue ("innerExceptions", innerExceptions);
                }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to