please collaborate on the following:
I have a Class class with N attributes:
public class Clase
{
private string atrib1;
private int atrib 2;
}
I want that when I use the class I can do (I think for a better management of resources) a:
using(Clase obj = new Clase())
{
..........
}
but it does not work that simple, right? I have to implement the IDispose interface (Class: IDispose) and explicitly implement the Dispose () method.
Well now if the million-dollar question comes: what code should I put in the Dispose () method so that both attribute attribute1 and attribute attribute2 are destroyed, released, etc., and also be destroyed, released, etc. the same object in question ???
public void Dispose()
{
???
}
Thanks in advance.