Invalid question and purely artificial "problem". Please see my comment to the question.
You never ever should cast to
IDisposable
. If some type does implements this interface, the
Dispose
call won't need the case, if not, the
object don't need to be disposed at all.
I don't know if you understand that this interface is generally unrelated to reclaiming of managed memory. Such reclaiming is done by the Garbage Collector after objects become
unreachable. So, just in case, please read about it:
http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29[
^].
—SA