I've a class called MyClass
which inherits from IDisposable
.
public class MyClass : IDisposable
{
public void Dispose()
{
// clean up
}
}
I'm not sure who is going to use my class, but I want to make sure that whoever is using my class must call Dispose()
method after he is done using MyClass
.
How can I force the user who is using MyClass
to call this Dispose()
method?