Sfoglia il codice sorgente

2005-06-07 Zoltan Varga <[email protected]>

	* *Token.cs: Add net 2.0 Equals methods.

svn path=/trunk/mcs/; revision=45578
Zoltan Varga 20 anni fa
parent
commit
cfb4d35d21

+ 4 - 0
mcs/class/corlib/System.Reflection.Emit/AssemblyBuilderAccess.cs

@@ -41,5 +41,9 @@ namespace System.Reflection.Emit
     Run = 1,
     Save = 2,
     RunAndSave = 3
+#if NET_2_0
+	,
+	ReflectionOnly = 6
+#endif
   }
 }

+ 2 - 0
mcs/class/corlib/System.Reflection.Emit/ChangeLog

@@ -1,5 +1,7 @@
 2005-06-07  Zoltan Varga  <[email protected]>
 
+	* *Token.cs: Add net 2.0 Equals methods.
+
 	* *.cs: Updates for net 2.0 beta 2.
 
 	* *.cs: Updates for net 2.0 beta 2.

+ 6 - 0
mcs/class/corlib/System.Reflection.Emit/EventToken.cs

@@ -71,6 +71,12 @@ namespace System.Reflection.Emit {
 			return res;
 		}
 
+#if NET_2_0
+		public bool Equals (EventToken obj)
+		{
+			return (this.tokValue == obj.tokValue);
+		}
+#endif
 
 		/// <summary>
 		///  Tests whether the given object is an instance of

+ 7 - 2
mcs/class/corlib/System.Reflection.Emit/FieldToken.cs

@@ -55,8 +55,6 @@ namespace System.Reflection.Emit {
 			tokValue = val;
 		}
 
-
-
 		/// <summary>
 		/// </summary>
 		public override bool Equals (object obj)
@@ -72,6 +70,13 @@ namespace System.Reflection.Emit {
 		}
 
 
+#if NET_2_0
+		public bool Equals (FieldToken obj)
+		{
+			return (this.tokValue == obj.tokValue);
+		}
+#endif
+
 		/// <summary>
 		///  Tests whether the given object is an instance of
 		///  FieldToken and has the same token value.

+ 9 - 0
mcs/class/corlib/System.Reflection.Emit/Label.cs

@@ -51,6 +51,15 @@ namespace System.Reflection.Emit {
 			return false;
 		}
 
+#if NET_2_0
+		[MonoTODO]
+		public bool Equals (Label obj)
+		{
+			/* FIXME: */
+			return false;
+		}
+#endif
+
 		public override int GetHashCode () {
 			return label.GetHashCode ();
 		}

+ 6 - 2
mcs/class/corlib/System.Reflection.Emit/MethodToken.cs

@@ -55,8 +55,6 @@ namespace System.Reflection.Emit {
 			tokValue = val;
 		}
 
-
-
 		/// <summary>
 		/// </summary>
 		public override bool Equals (object obj)
@@ -71,6 +69,12 @@ namespace System.Reflection.Emit {
 			return res;
 		}
 
+#if NET_2_0
+		public bool Equals (MethodToken obj)
+		{
+			return (this.tokValue == obj.tokValue);
+		}
+#endif
 
 		/// <summary>
 		///  Tests whether the given object is an instance of

+ 7 - 0
mcs/class/corlib/System.Reflection.Emit/OpCode.cs

@@ -76,6 +76,13 @@ namespace System.Reflection.Emit {
 			return v.op1 == op1 && v.op2 == op2;
 		}
 
+#if NET_2_0
+		public bool Equals (OpCode obj)
+		{
+			return obj.op1 == op1 && obj.op2 == op2;
+		}
+#endif
+
 		public override string ToString ()
 		{
 			return Name;

+ 6 - 2
mcs/class/corlib/System.Reflection.Emit/ParameterToken.cs

@@ -55,8 +55,6 @@ namespace System.Reflection.Emit {
 			tokValue = val;
 		}
 
-
-
 		/// <summary>
 		/// </summary>
 		public override bool Equals (object obj)
@@ -71,6 +69,12 @@ namespace System.Reflection.Emit {
 			return res;
 		}
 
+#if NET_2_0
+		public bool Equals (ParameterToken obj)
+		{
+			return (this.tokValue == obj.tokValue);
+		}
+#endif
 
 		/// <summary>
 		///  Tests whether the given object is an instance of

+ 6 - 2
mcs/class/corlib/System.Reflection.Emit/PropertyToken.cs

@@ -55,8 +55,6 @@ namespace System.Reflection.Emit {
 			tokValue = val;
 		}
 
-
-
 		/// <summary>
 		/// </summary>
 		public override bool Equals (object obj)
@@ -71,6 +69,12 @@ namespace System.Reflection.Emit {
 			return res;
 		}
 
+#if NET_2_0
+		public bool Equals (PropertyToken obj)
+		{
+			return (this.tokValue == obj.tokValue);
+		}
+#endif
 
 		/// <summary>
 		///  Tests whether the given object is an instance of

+ 6 - 2
mcs/class/corlib/System.Reflection.Emit/SignatureToken.cs

@@ -55,8 +55,6 @@ namespace System.Reflection.Emit {
 			tokValue = val;
 		}
 
-
-
 		/// <summary>
 		/// </summary>
 		public override bool Equals (object obj)
@@ -71,6 +69,12 @@ namespace System.Reflection.Emit {
 			return res;
 		}
 
+#if NET_2_0
+		public bool Equals (SignatureToken obj)
+		{
+			return (this.tokValue == obj.tokValue);
+		}
+#endif
 
 		/// <summary>
 		///  Tests whether the given object is an instance of

+ 6 - 2
mcs/class/corlib/System.Reflection.Emit/StringToken.cs

@@ -51,8 +51,6 @@ namespace System.Reflection.Emit {
 			tokValue = val;
 		}
 
-
-
 		/// <summary>
 		/// </summary>
 		public override bool Equals (object obj)
@@ -67,6 +65,12 @@ namespace System.Reflection.Emit {
 			return res;
 		}
 
+#if NET_2_0
+		public bool Equals (StringToken obj)
+		{
+			return (this.tokValue == obj.tokValue);
+		}
+#endif
 
 		/// <summary>
 		///  Tests whether the given object is an instance of

+ 6 - 2
mcs/class/corlib/System.Reflection.Emit/TypeToken.cs

@@ -55,8 +55,6 @@ namespace System.Reflection.Emit {
 			tokValue = val;
 		}
 
-
-
 		/// <summary>
 		/// </summary>
 		public override bool Equals (object obj)
@@ -71,6 +69,12 @@ namespace System.Reflection.Emit {
 			return res;
 		}
 
+#if NET_2_0
+		public bool Equals (TypeToken obj)
+		{
+			return (this.tokValue == obj.tokValue);
+		}
+#endif
 
 		/// <summary>
 		///  Tests whether the given object is an instance of