[Mono-list] Enum.Equals() confusion

Nick Drochak ndrochak@gol.com
Mon, 18 Mar 2002 18:29:27 +0900


| I have fixed the implementation - we simply need to check if objects are
| of the same type:
| 
| 
| 		public override bool Equals (object obj)
| 		{
| 			if (obj.GetType() != this.GetType())
| 				return false;
| 
| 			object v1 = this.get_value ();
| 			object v2 = ((Enum)obj).get_value ();
| 
| 			return v1.Equals (v2);
| 		}

Ah.  Too simple.  I see it now.

Thanks,
Nick D.