Table of Contents

Method EnsureCreated

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

EnsureCreated(ref MeasureItemEventArgs?, Graphics, int)

Ensures that the specified MeasureItemEventArgs instance is initialized and associated with the given Graphics context and item index.

public static void EnsureCreated(ref MeasureItemEventArgs? e, Graphics graphics, int index = 0)

Parameters

e MeasureItemEventArgs

A reference to the MeasureItemEventArgs instance to initialize or reset. If null, a new instance will be created and assigned.

graphics Graphics

The Graphics context to associate with the event arguments. Cannot be null.

index int

The index of the item to be measured. The default value is 0.

EnsureCreated(ref MeasureItemEventArgs?, Graphics, int, float)

Ensures that the specified MeasureItemEventArgs instance is initialized with the provided graphics context, item index, and item height.

public static void EnsureCreated(ref MeasureItemEventArgs? e, Graphics graphics, int index, float itemHeight)

Parameters

e MeasureItemEventArgs

A reference to the MeasureItemEventArgs instance to initialize. If null, a new instance is created and assigned.

graphics Graphics

The Graphics context used for measuring the item. Cannot be null.

index int

The zero-based index of the item to measure.

itemHeight float

The height of the item to be measured.

Remarks

If e is already initialized, its state is reset with the new parameters. Otherwise, a new MeasureItemEventArgs is created and assigned to e.