Author: spouliot
Date: 2005-12-05 13:44:17 -0500 (Mon, 05 Dec 2005)
New Revision: 53939
Modified:
trunk/mcs/class/corlib/System.Collections/ChangeLog
trunk/mcs/class/corlib/System.Collections/Comparer.cs
Log:
2005-12-05 Sebastien Pouliot <[EMAIL PROTECTED]>
* Comparer.cs: Added GetObjectData method to implement ISerializable.
Modified: trunk/mcs/class/corlib/System.Collections/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Collections/ChangeLog 2005-12-05 18:43:07 UTC
(rev 53938)
+++ trunk/mcs/class/corlib/System.Collections/ChangeLog 2005-12-05 18:44:17 UTC
(rev 53939)
@@ -1,3 +1,7 @@
+2005-12-05 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * Comparer.cs: Added GetObjectData method to implement ISerializable.
+
2005-09-29 Miguel de Icaza <[EMAIL PROTECTED]>
* Add ComVisible(true) to all the classes that needed it.
Modified: trunk/mcs/class/corlib/System.Collections/Comparer.cs
===================================================================
--- trunk/mcs/class/corlib/System.Collections/Comparer.cs 2005-12-05
18:43:07 UTC (rev 53938)
+++ trunk/mcs/class/corlib/System.Collections/Comparer.cs 2005-12-05
18:44:17 UTC (rev 53939)
@@ -1,13 +1,12 @@
//
// System.Collections.Comparer.cs
//
-// Author:
-// Sergey Chaban ([EMAIL PROTECTED])
+// Authors:
+// Sergey Chaban ([EMAIL PROTECTED])
+// Sebastien Pouliot <[EMAIL PROTECTED]>
//
-
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
@@ -30,6 +29,8 @@
using System.Globalization;
using System.Runtime.InteropServices;
+using System.Runtime.Serialization;
+using System.Security.Permissions;
namespace System.Collections
{
@@ -37,8 +38,8 @@
[ComVisible(true)]
#endif
[Serializable]
- public sealed class Comparer : IComparer
- {
+ public sealed class Comparer : IComparer, ISerializable {
+
public static readonly Comparer Default = new Comparer ();
#if NET_1_1
public
@@ -90,7 +91,17 @@
else if (b is IComparable)
return -(b as IComparable).CompareTo (a);
- throw new ArgumentException (Locale.GetText ("Neither a
nor b Comparable."));
+ throw new ArgumentException (Locale.GetText ("Neither
'a' nor 'b' implements IComparable."));
}
+
+ // ISerializable
+ [SecurityPermission (SecurityAction.LinkDemand,
SerializationFormatter = true)]
+ public void GetObjectData (SerializationInfo info,
StreamingContext context)
+ {
+ if (info == null)
+ throw new ArgumentNullException ("info");
+
+ info.AddValue ("CompareInfo", _culture.CompareInfo,
typeof (CompareInfo));
+ }
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches