/Usable

Disposable, without the Using

Primary LanguageC#

Usable is an add-in for Fody

Usable Icon - A waste paper basket.

Usable adds using statements for local variables that have been created, and implement IDisposable.

Nuget

Nuget package http://nuget.org/packages/Usable.Fody

To Install from the Nuget Package Manager Console

PM> Install-Package Usable.Fody

Your Code

public void Method()
{
    var w = File.CreateText("log.txt");
    w.WriteLine("I'm a lumberjack an' I'm ok.");
}

What gets compiled

public void Method()
{
    using (var w = File.CreateText("log.txt"))
    {
        w.WriteLine("I'm a lumberjack an' I'm ok.");
    }
}

Contributors

Icon

Trash designed by Shirley Wu from The Noun Project