Class DisposableObjectSlim
Abstract implementation of managed IDisposable.
Inheritance
System.Object
Namespace: Umbraco.Cms.Core
Assembly: Umbraco.Core.dll
Syntax
public abstract class DisposableObjectSlim : IDisposable
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.
Properties
View SourceDisposed
Gets a value indicating whether this instance is disposed.
Declaration
public bool Disposed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
for internal tests only (not thread safe)
Methods
View SourceDispose()
Declaration
public void Dispose()
Dispose(Boolean)
Disposes managed resources
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | 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()