Table of Contents

Class DisposableManager

Namespace
DrawnUi.Views
Assembly
DrawnUi.Maui.dll
public class DisposableManager : IDisposable
Inheritance
DisposableManager
Implements
Inherited Members
Extension Methods

Constructors

DisposableManager(int)

Initializes a new instance of the DisposableManager class.

public DisposableManager(int framesToHold = 3)

Parameters

framesToHold int

The number of frames to hold before disposing. Default is 3 frames.

Properties

Count

public int Count { get; }

Property Value

int

IsDisposed

public bool IsDisposed { get; set; }

Property Value

bool

PendingDisposalCount

Gets the number of items waiting for disposal.

public int PendingDisposalCount { get; }

Property Value

int

Methods

Dispose()

Disposes all remaining disposables immediately.

public void Dispose()

DisposeDisposables(long)

Disposes of all IDisposable objects that are old enough based on frame count. Call this before every frame start.

public void DisposeDisposables(long currentFrameNumber)

Parameters

currentFrameNumber long

The current frame number.

EnqueueDisposable(IDisposable, long)

Enqueues an IDisposable object with the specified frame number.

public void EnqueueDisposable(IDisposable disposable, long frameNumber)

Parameters

disposable IDisposable

The IDisposable object to enqueue.

frameNumber long

The frame number when this resource was created/last used.