Lean  $LEAN_TAG$
QuantConnect.Util.DisposableExtensions Class Reference

Provides extensions methods for IDisposable More...

Static Public Member Functions

static bool DisposeSafely (this IDisposable disposable)
 Calls IDisposable.Dispose within a try/catch and logs any errors. More...
 
static bool DisposeSafely (this IDisposable disposable, Action< Exception > errorHandler)
 Calls IDisposable.Dispose within a try/catch and invokes the errorHandler on any errors. More...
 

Detailed Description

Provides extensions methods for IDisposable

Definition at line 25 of file DisposableExtensions.cs.

Member Function Documentation

◆ DisposeSafely() [1/2]

static bool QuantConnect.Util.DisposableExtensions.DisposeSafely ( this IDisposable  disposable)
static

Calls IDisposable.Dispose within a try/catch and logs any errors.

Parameters
disposableThe IDisposable to be disposed
Returns
True if the object was successfully disposed, false if an error was thrown

Definition at line 32 of file DisposableExtensions.cs.

Here is the call graph for this function:

◆ DisposeSafely() [2/2]

static bool QuantConnect.Util.DisposableExtensions.DisposeSafely ( this IDisposable  disposable,
Action< Exception >  errorHandler 
)
static

Calls IDisposable.Dispose within a try/catch and invokes the errorHandler on any errors.

Parameters
disposableThe IDisposable to be disposed
errorHandlerError handler delegate invoked if an exception is thrown while calling IDisposable.Dispose

on disposable

Returns
True if the object was successfully disposed, false if an error was thrown or the specified disposable was null

Definition at line 46 of file DisposableExtensions.cs.


The documentation for this class was generated from the following file: