I have this class:
public abstract class ImplementsIDisposable : IDisposable
{
public abstract void Dispose();
private class InnerClass : ImplementsIDisposable
{
private bool disposedValue;
public override void Dispose()
{
if (!disposedValue)
{
doSomething();
disposedValue = true;
}
GC.SuppressFinalize(this);
}
}
}
And Code Analysis is throwing this message:
CA1063 Modify Dispose() so that it calls Dispose(true), then calls GC.SuppressFinalize on the current object instance and then returns.
And this one:
CA1063 Ensure that Dispose() is declared as public and sealed.
Both in the this line:
public abstract void Dispose();
Can it be that it wants Dispose()
to be implemented in ImplementsIDisposable
instead of InnerClass
?