L
lyubomirskiy
Hi,
I was wondering if it is possible to obtain instance id of any random
instantiated object during execution of a C# program. I am guessing
that System.Runtime namespace might be used for this, but I have no
clue as to the specifics. I cannot just insert the id field into the
class declaration, I need to be able to work with objects of already
defined classes.
As an alternative to getting instance ids I can also assign my own ids
by storing all newly created objects of all types in a hashtable, but
this would create difficulties if the object supports a nontrivial hash
function and would require chaining etc. So I am hoping to do it simply
with instance ids, if possible.
Thanks ahead of time for replying.
I was wondering if it is possible to obtain instance id of any random
instantiated object during execution of a C# program. I am guessing
that System.Runtime namespace might be used for this, but I have no
clue as to the specifics. I cannot just insert the id field into the
class declaration, I need to be able to work with objects of already
defined classes.
As an alternative to getting instance ids I can also assign my own ids
by storing all newly created objects of all types in a hashtable, but
this would create difficulties if the object supports a nontrivial hash
function and would require chaining etc. So I am hoping to do it simply
with instance ids, if possible.
Thanks ahead of time for replying.