This pattern from OpenSCManager seems like a neat way of doing a C# style using block so have copied it to make the other methods much more concise.