Search Results for

    Show / Hide Table of Contents
    View Source

    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 Source

    Disposed

    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 Source

    Dispose()

    Declaration
    public void Dispose()
    View Source

    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.

    View Source

    DisposeResources()

    Disposes managed resources

    Declaration
    protected abstract void DisposeResources()
    • Improve this Doc
    • View Source
    In This Article
    • Properties
      • Disposed
    • Methods
      • Dispose()
      • Dispose(Boolean)
      • DisposeResources()
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX