Testing equality of pens
From: Tristan (anonymous_at_discussions.microsoft.com)
Date: 03/05/04
- Next message: Morten Wennevik: "Re: Private Constructor"
- Previous message: Marcin Grzębski: "Re: Private Constructor"
- Next in thread: ChrisM: "Re: Testing equality of pens"
- Reply: ChrisM: "Re: Testing equality of pens"
- Reply: noah: "Re: Testing equality of pens"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 5 Mar 2004 02:56:07 -0800
Hi,
I'm trying to test if two Pen objects are equal as shown below:
Pen p1 = new Pen(Color.Black);
Pen p2 = new Pen(Color.Black);
if (p1.Equals(p2))
{
Console.WriteLine("These pens equal");
}
The problem is that the if statement doesn't return true, I would have thought that p1 and p2 are the same. Is the only way round this to write my own function which compares every single property of Pen? That would be very laborious and time consuming!
Help much appreciated.
Tristan.
- Next message: Morten Wennevik: "Re: Private Constructor"
- Previous message: Marcin Grzębski: "Re: Private Constructor"
- Next in thread: ChrisM: "Re: Testing equality of pens"
- Reply: ChrisM: "Re: Testing equality of pens"
- Reply: noah: "Re: Testing equality of pens"
- Messages sorted by: [ date ] [ thread ]