Class DisposableObjectSlim
Abstract implementation of managed IDisposable.
Inheritance
object
Namespace: Umbraco.Cms.Core
Assembly: Umbraco.Core.dll
Syntax
public abstract class DisposableObjectSlim
Remarks
This is for objects that do NOT have unmanaged resources. Can also be used as a pattern for when inheriting is not possible. See also: https://msdn.microsoft.com/en-us/library/b1yfkh5e%28v=vs.110%29.aspx See also: https://lostechies.com/chrispatterson/2012/11/29/idisposable-done-right/ Note: if an object's ctor throws, it will never be disposed, and so if that ctor has allocated disposable objects, it should take care of disposing them.
Constructors
View SourceDisposableObjectSlim()
Declaration
protected DisposableObjectSlim()
Properties
View SourceDisposed
Gets a value indicating whether this instance is disposed.
Declaration
public bool Disposed { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
for internal tests only (not thread safe)
Methods
View SourceDispose()
Declaration
public void Dispose()
Dispose(bool)
Disposes managed resources
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | True if disposing via Dispose method and not a finalizer. Always true for this class. |
DisposeResources()
Disposes managed resources
Declaration
protected abstract void DisposeResources()