RE: Disposing by reflection?
Tech-Archive recommends: Fix windows errors by optimizing your registry
- From: "Steven Wolf" <apoc69@xxxxxxx>
- Date: Wed, 13 Apr 2005 11:57:01 -0700
oh, i forgot to put the question...
what do you use or prefer in order to dispose everything property?
would you disadvise me using reflection to dispose everything?
"Steven Wolf" wrote:
> I like to implement IDisposable in my classes,
> but at a certain point its becoming boring when i have to take care about
> setting all members in a class to null..sometimes i forgot that also..
>
> but i could avoid that, by using reflection..just iterating thru all local
> members and set them null, but i guess this would slow down the code..
>
>
>
.
Relevant Pages
- Re: Object initialized in a try-catch
... The Components implements IDisposable and IComponent, which means that all derived classes should contain at least the same members with the same signature as those interfaces. ... In components however is a standard behaviour created, so that dispose is always in the same way in the classes deriving from components. ... But as you use an dispose in an AdoNet object, it does normally not hurt, beside in those cases that you use it incorrect and can give the problems as is written in the message from the OP and like Scott wrote: it makes your program less readable and therefore less maintainable. ... (microsoft.public.dotnet.languages.vb) - Re: Dispose() Question?
... How did you get the code of the Dispose method of the SqlConnection class? ... >> SqlConnection Object close the opened connection to database? ... With reflection you an read the method Diponse in SqlConnection class: ... (microsoft.public.dotnet.framework.aspnet) - Checking if an object has already been Disposed
... I'm working with some Image objects and I need to know if they've had their ... Dispose method called. ... Again, because it's reflection, it's slow. ... (microsoft.public.dotnet.framework) - Re: Deterministic Collection Using Generics
... Add, Clear, and Invoke to see if the object has been disposed. ... calling Dispose while another calls Invoke after the object has been ... > IInvoke and IDisposable and Adds types that implement IInvoke and ... > called on all members of the collection. ... (microsoft.public.dotnet.languages.csharp) - Re: Does DataGridView.Dispose Call DataGridViewRow.Dispose?
... the things, like DataGridViewRow, contained with the DataGridView? ... Just call Dispose on DataGridView. ... In general all you need to do is call Dispose on the root object and ... let it determine which of it's members it needs to call Dispose on. ... (microsoft.public.dotnet.languages.vb) |
|