Re: Distinguishing between one instance object to another instance
From: Stu Smith (stuarts_at_nospam-digita.com)
Date: 09/07/04
- Next message: Patty O'Dors: "Re: custom licensing scheme"
- Previous message: Kavvy: "accessor pairs - bad examples abound?"
- In reply to: Nadav: "Re: Distinguishing between one instance object to another instance"
- Next in thread: Nadav: "Re: Distinguishing between one instance object to another instance"
- Reply: Nadav: "Re: Distinguishing between one instance object to another instance"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 7 Sep 2004 12:24:36 +0100
You could add a property to your base class, which evaluates
base.GetHashCode() (ie the Object one) and returns that value.
"Nadav" <Nadav@discussions.microsoft.com> wrote in message
news:80C9C56E-BFD7-4AFD-B248-2B88FA8B75BD@microsoft.com...
> Yess, thats true, BUT for me it is the same as calling
object.GetHashCode(),
> I still would have to call a function rather then evaluate a property,
> evaluating a property can be done while debugging through the watch
views...
> while calling a function is less intuitive...
>
> "Peter Rilling" wrote:
>
> > Are you talking about determining if two instances point to the same
object?
> > If so, you could use Object.ReferenceEquals(...).
> >
> > "Nadav" <Nadav@discussions.microsoft.com> wrote in message
> > news:65975E35-03EA-4C41-B889-C13FB7F09EA7@microsoft.com...
> > > Hi,
> > >
> > > Introduction:
> > > *********
> > > I have a program that manage a pool of objects of the same type, while
> > > debugging I set a breakpoint in one of the methods of that type
> > >
> > > The problem:
> > > **********
> > > I didn't find a way of distinguishing between one object and the
other, in
> > > C++ it is possible to distinguish between one object to the other
> > > according
> > > to the 'this' address... as safe managed code doesn't support pointers
I
> > > cannot do that in safe C#, it is possible to use the GetHashCode
method
> > > BUT
> > > as this is a method ( and not a property ) it would have to be
executed
> > > through the 'command' window which makes it not so convinient...
> > >
> > > SOoooo... Is there any other way to distinguish between one object to
the
> > > other using 'safe' managed code?
> > > --
> > > Nadav
> > > http://www.ddevel.com
> >
> >
> >
- Next message: Patty O'Dors: "Re: custom licensing scheme"
- Previous message: Kavvy: "accessor pairs - bad examples abound?"
- In reply to: Nadav: "Re: Distinguishing between one instance object to another instance"
- Next in thread: Nadav: "Re: Distinguishing between one instance object to another instance"
- Reply: Nadav: "Re: Distinguishing between one instance object to another instance"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|