Table of Contents

Class DisposableExtensions

Namespace
VpnHood.Net.Toolkit.Extensions
Assembly
VpnHood.Net.Toolkit.dll

Provides a disposal helper for IDisposable that logs a failure instead of throwing it.

public static class DisposableExtensions
Inheritance
DisposableExtensions
Inherited Members

Methods

TryDispose(IDisposable?, LogLevel)

Disposes an object, and logs a failure instead of throwing it; a null object is passed over.

public static void TryDispose(this IDisposable? disposable, LogLevel failureLevel)

Parameters

disposable IDisposable

The object, or null.

failureLevel LogLevel

The level a failure is logged at; a cancellation is logged at Debug.

Remarks

It is meant for another library's types, whose close may throw.