I have the following class which uses BinaryReader internally and implements IDisposable.
class DisposableClass : IDisposable
{
private BinaryReader r
It won't work because the Dispose method on BinaryReader has been explicitly implemented.
Instead of being implicitly implemented, as in:
public void Dispose()
{
}
...it has been explicitly implemented, as in:
void IDisposable.Dispose()
{
}
...which means it can only be accessed via the IDisposable interface. Therefore, you have to cast the instance to IDisposable first.