How to get or Kill all instances from certain class?

Posted by Ehab Sutan on Stack Overflow See other posts from Stack Overflow or by Ehab Sutan
Published on 2010-05-29T14:38:07Z Indexed on 2010/05/29 14:52 UTC
Read the original article Hit count: 185

Filed under:

How can I get all instances from a certain class or kill all instances of certain class?

For Example, I've a Class MyClass which I intantiate three times as m1, m2 and m3.

Is there a way to get or kill all these instances?

more clarification : when I've a "settings form" class. When the user click Settings button the application makes instance from this class. When he clicks the same button again it makes new instance. I want it show the 1st instance only and not making new instance

© Stack Overflow or respective owner

Related posts about c#