Click here to Skip to main content
15,913,487 members
Home / Discussions / C#
   

C#

 
QuestionNameValueCollection or HashTable Pin
student_rhr20-Feb-06 5:34
student_rhr20-Feb-06 5:34 
GeneralRe: NameValueCollection or HashTable Pin
Guffa20-Feb-06 7:04
Guffa20-Feb-06 7:04 
AnswerRe: NameValueCollection or HashTable Pin
NatLang20-Feb-06 9:12
NatLang20-Feb-06 9:12 
AnswerRe: NameValueCollection or HashTable Pin
leppie20-Feb-06 10:57
leppie20-Feb-06 10:57 
QuestionDesign Strategy Question Pin
gantww20-Feb-06 5:28
gantww20-Feb-06 5:28 
AnswerRe: Design Strategy Question Pin
Alvaro Mendez20-Feb-06 6:34
Alvaro Mendez20-Feb-06 6:34 
GeneralRe: Design Strategy Question Pin
gantww20-Feb-06 7:35
gantww20-Feb-06 7:35 
GeneralRe: Design Strategy Question Pin
Alvaro Mendez20-Feb-06 8:06
Alvaro Mendez20-Feb-06 8:06 
I'd go with your first idea, which I would implement something like this:

1. Create an interface, such as:

interface IMyObjectUser
{
   event EventHandler Disposing;
}
2. I'd have all my users (Views, in your case) implement this interface to raise the Disposing event whenever they call Dispose.

3. I'd pass an IMyObjectUser object to the constructor of your object (or the factory, in your case). In there, I would subscribe to the Disposing event and then store the object inside an ArrayList.

4. Inside the Disposing handler I would locate the object (View) inside the ArrayList and remove it from the list. If the list's Count reaches 0, I would know that no one else is referencing my object and proceed accordingly.

Regards,
Alvaro


... now you see that evil will always triumph, because good is dumb. - Dark Helmet
GeneralRe: Design Strategy Question Pin
gantww21-Feb-06 14:04
gantww21-Feb-06 14:04 
QuestionForm Close Pin
mostafa_h20-Feb-06 5:05
mostafa_h20-Feb-06 5:05 
AnswerRe: Form Close Pin
User 665820-Feb-06 5:09
User 665820-Feb-06 5:09 
GeneralRe: Form Close Pin
Judah Gabriel Himango20-Feb-06 5:12
sponsorJudah Gabriel Himango20-Feb-06 5:12 
GeneralRe: Form Close Pin
delphidab22-Feb-06 7:12
delphidab22-Feb-06 7:12 
AnswerRe: Form Close Pin
Alvaro Mendez20-Feb-06 7:39
Alvaro Mendez20-Feb-06 7:39 
GeneralRe: Form Close Pin
mostafa_h20-Feb-06 9:29
mostafa_h20-Feb-06 9:29 
GeneralRe: Form Close Pin
Alvaro Mendez20-Feb-06 10:02
Alvaro Mendez20-Feb-06 10:02 
GeneralRe: Form Close Pin
mostafa_h21-Feb-06 2:39
mostafa_h21-Feb-06 2:39 
QuestionTrying to create a Web-Like Menu Pin
Jettajon20-Feb-06 4:49
Jettajon20-Feb-06 4:49 
QuestionWhen we can convert STRUCT into CLASS ? Pin
Ariston Darmayuda20-Feb-06 4:44
Ariston Darmayuda20-Feb-06 4:44 
AnswerRe: When we can convert STRUCT into CLASS ? Pin
Judah Gabriel Himango20-Feb-06 4:49
sponsorJudah Gabriel Himango20-Feb-06 4:49 
QuestionDataGridView and ComboBox Pin
zaboboa20-Feb-06 4:10
zaboboa20-Feb-06 4:10 
AnswerRe: DataGridView and ComboBox Pin
USrinivas20-Feb-06 17:12
USrinivas20-Feb-06 17:12 
QuestionClose Button Pin
alee15.10.8820-Feb-06 3:46
alee15.10.8820-Feb-06 3:46 
AnswerRe: Close Button Pin
J4amieC20-Feb-06 4:37
J4amieC20-Feb-06 4:37 
AnswerRe: Close Button Pin
User 665820-Feb-06 4:41
User 665820-Feb-06 4:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.