-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Giri19761
Message 2 in Discussion

hi Anjili   to avoid finalze method u can use IDisposable interface 
The following rules outline the usage guidelines for the Finalize method:       Only 
implement Finalize on objects that require finalization. There are performance costs 
associated with Finalize methods.     If you require a Finalize method, you should 
consider implementing IDisposable to allow users of your class to avoid the cost of 
invoking the Finalize method.          Do not make the Finalize method more visible. 
It should be protected, not public.       An object's Finalize method should free any 
external resources that the object owns. Moreover, a Finalize method should release 
only resources that are held onto by the object. The Finalize method should not 
reference any other objects.    Do not directly call a Finalize method on an object 
other than the object's base class. This is not a valid operation in the C# 
programming language.   Call the base.Finalize method from an object's Finalize 
method.  Note   The base class's Finalize method is called automatically with the C# 
and the Managed Extensions for C++ destructor syntax. Dispose 
The following rules outline the usage guidelines for the Dispose method:        
Implement the dispose design pattern on a type that encapsulates resources that 
explicitly need to be freed. Users can free external resources by calling the public 
Dispose method.    Implement the dispose design pattern on a base type that commonly 
has derived types that hold on to resources, even if the base type does not. If the 
base type has a close method, often this indicates the need to implement Dispose. In 
such cases, do not implement a Finalize method on the base type. Finalize should be 
implemented in any derived types that introduce resources that require cleanup.        
  Free any disposable resources a type owns in its Dispose method.        After 
Dispose has been called on an instance, prevent the Finalize method from running by 
calling the GC.SuppressFinalize Method. The exception to this rule is the rare 
situation in which work must be done in Finalize that is not covered by Dispose.       
Call the base class's Dispose method if it implements IDisposable.      Do not assume 
that Dispose will be called. Unmanaged resources owned by a type should also be 
released in a Finalize method in the event that Dispose is not called.    Throw an 
ObjectDisposedException from instance methods on this type (other than Dispose) when 
resources are already disposed. This rule does not apply to the Dispose method because 
it should be callable multiple times without throwing an exception.        Propagate 
the calls to Dispose through the hierarchy of base types. The Dispose method should 
free all resources held by this object and any object owned by this object. For 
example, you can create an object like a TextReader that holds onto a Stream and an 
Encoding, both of which are created by the TextReader without the user's knowledge. 
Furthermore, both the Stream and the Encoding can acquire external resources. When you 
call the Dispose method on the TextReader, it should in turn call Dispose on the 
Stream and the Encoding, causing them to release their external resources.        You 
should consider not allowing an object to be usable after its Dispose method has been 
called. Recreating an object that has already been disposed is a difficult pattern to 
implement.      Allow a Dispose method to be called more than once without throwing an 
exception. The method should do nothing after the first call.    use this links  
http://www.dotnetspider.com/Technology/KB/ShowSample.aspx?SampleId=366   GIRISH 
HONGAL....

-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/BDotNet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you received 
this message by mistake, please click the "Remove" link below. On the pre-addressed 
e-mail message that opens, simply click "Send". Your e-mail address will be deleted 
from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to