Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnome.org>2007-11-18 08:01:04 +0300
committerMiguel de Icaza <miguel@gnome.org>2007-11-18 08:01:04 +0300
commit94f024812220e86b47efc02688930f1df277a956 (patch)
tree9f122e29b0469c839cdace56b23d6fe639d371ca /mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs
parent0f3eee0e538e4a9ff352448e40b8b209e3a81396 (diff)
2007-11-18 Miguel de Icaza <miguel@novell.com>
* SignatureHelper.cs: Implement Equals and GetHashCode svn path=/trunk/mcs/; revision=89881
Diffstat (limited to 'mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs')
-rw-r--r--mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs73
1 files changed, 69 insertions, 4 deletions
diff --git a/mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs b/mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs
index fcfafe52651..9e992c25e2b 100644
--- a/mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs
+++ b/mcs/class/corlib/System.Reflection.Emit/SignatureHelper.cs
@@ -267,16 +267,81 @@ namespace System.Reflection.Emit {
throw new NotImplementedException ();
}
- [MonoTODO("Not implemented")]
+ static bool CompareOK (Type [][] one, Type [][] two)
+ {
+ if (one == null){
+ if (two == null)
+ return true;
+ return false;
+ } else if (two == null)
+ return false;
+
+ if (one.Length != two.Length)
+ return false;
+
+ for (int i = 0; i < one.Length; i++){
+ Type [] tone = one [i];
+ Type [] ttwo = two [i];
+
+ if (tone == null){
+ if (ttwo == null)
+ continue;
+ } else if (ttwo == null)
+ return false;
+
+ if (tone.Length != ttwo.Length)
+ return false;
+
+ for (int j = 0; j < tone.Length; j++){
+ Type uone = tone [j];
+ Type utwo = ttwo [j];
+
+ if (uone == null){
+ if (utwo == null)
+ continue;
+ return false;
+ } else if (utwo == null)
+ return false;
+
+ if (!uone.Equals (utwo))
+ return false;
+ }
+ }
+ return true;
+ }
+
public override bool Equals (object obj)
{
- throw new NotImplementedException ();
+ SignatureHelper other = obj as SignatureHelper;
+ if (other == null)
+ return false;
+
+ if (other.module != module ||
+ other.returnType != returnType ||
+ other.callConv != callConv ||
+ other.unmanagedCallConv != unmanagedCallConv)
+ return false;
+
+ if (arguments != null){
+ if (other.arguments == null)
+ return false;
+ if (arguments.Length != other.arguments.Length)
+ return false;
+
+ for (int i = 0; i < arguments.Length; i++)
+ if (!other.arguments [i].Equals (arguments [i]))
+ return false;
+ } else if (other.arguments != null)
+ return false;
+
+ return CompareOK (other.modreqs, modreqs) && CompareOK (other.modopts, modopts);
}
- [MonoTODO("Not implemented")]
public override int GetHashCode ()
{
- throw new NotImplementedException ();
+ // Lame, but easy, and will work, and chances are
+ // you will only need a few of these.
+ return 0;
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]