Update of /cvsroot/adapdev/Adapdev/src/Adapdev
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26163/src/Adapdev
Modified Files:
ObjectComparer.cs
Log Message:
Index: ObjectComparer.cs
===================================================================
RCS file: /cvsroot/adapdev/Adapdev/src/Adapdev/ObjectComparer.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ObjectComparer.cs 16 Nov 2005 07:02:01 -0000 1.9
--- ObjectComparer.cs 26 Nov 2005 08:51:25 -0000 1.10
***************
*** 1,5 ****
--- 1,7 ----
using System;
using System.Reflection;
+ using System.Runtime.Serialization;
using Adapdev.Reflection;
+ using Adapdev.Serialization;
namespace Adapdev
***************
*** 14,17 ****
--- 16,24 ----
}
+ public static bool AreEqual(ISerializable x, ISerializable y)
+ {
+ return AreBytesEqual(Serializer.SerializeToBinary(x), Serializer.SerializeToBinary(y));
+ }
+
public static bool AreEqual(object x, object y)
{
***************
*** 59,62 ****
--- 66,86 ----
return true;
}
+
+ public static bool AreBytesEqual(byte[] a, byte[] b)
+ {
+ int i=0;
+ bool same=true;
+ do
+ {
+ if(a[i]!=b[i])
+ {
+ same=false;
+ break;
+ }
+ i++;
+ }while(i<a.Length);
+
+ return same;
+ }
}
}
|