.NET IDisposable interface does a portion of C++'s "delete", namely the
deallocation of resources (of course in .NET, the GC handles the actual
free() to release memory). Once an object has been Dispose()'d, it really
shouldn't be used anymore; you can make your methods throw an
ObjectDisposedException.
Dan
"perry"
wrote in message
news:5380800@discussion.autodesk.com...
In an app I'm working on I have several (non static) classed defined.
A couple of these, lets call them CLASS-A and CLASS-B deal with
particular types of blocks.
During the course of my apps life, its likely these classes will be
instantiated more than once. What can happen then is I may have several
objects of CLASS-A which may be associated with the same block
reference. This is not the type of behavior I want. With C++ this wasn't
an issue because I'd delete the object after using it, not so with C#.
So how could I go about creating an object only if it does not already
exist or is not associated with a block ref that is already being "watched"?
I would not think that making these classes "disposable" would help.
Calling dispose is not like deleting in C++, the object will still be in
memory and still accessible.
Make the class Static and just have its methods reference a different
block each time its called, depending on circumstances?
Thanks for any tips.
Perry