public static IDisposable CombineWith(this IDisposable disposable, [InstantHandle] Action setup = null, [InstantHandle] Action cleanup = null) { return(DelegateDisposable.CreateBracket( setup, () => { cleanup?.Invoke(); disposable.Dispose(); })); }
public IDisposable Indent() { return DelegateDisposable.CreateBracket( () => _indentation++, () => _indentation--); }