[ x] I have verified that I am running the latest version of DisposableFixer: 1.1.0
[ x] I have searched open and closed issues to ensure it has not already been reported
Description
When a IDisposable-property is disposed with this.Property?.Dispose() this is not recognized and the DF0022 warning is generated for that property.
The "this." prefix is mandatory by our convention.
With VS 15.8.0: formating code (CTRL+E,CTRL+D) adds the "this." prefix automatically.
Source Code
public class Dummy : IDisposable
{
public ManualResetEvent MRE { get; }
= new ManualResetEvent(false);
public void Dispose()
{
this.MRE?.Dispose();
}
}
Prerequisites
Description
When a IDisposable-property is disposed with this.Property?.Dispose() this is not recognized and the DF0022 warning is generated for that property. The "this." prefix is mandatory by our convention. With VS 15.8.0: formating code (CTRL+E,CTRL+D) adds the "this." prefix automatically.
Source Code