New to Telerik UI for WinForms? Start a free 30-day trial

Stores UI layers in display order and provides lookup and insertion by layer name.

Definition

Namespace:Telerik.WinForms.Documents.UI.Layers

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class UILayerStack : IEnumerable

Inheritance: objectUILayerStack

Implements: IEnumerable

Constructors

Initializes an empty layer stack.

C#
public UILayerStack()

Properties

Gets the number of layers in the stack.

C#
public int Count { get; }

Gets whether the stack can be modified; this collection is writable.

C#
public bool IsReadOnly { get; }

Methods

Inserts a layer immediately after the named layer.

C#
public bool AddAfter(string presentedLayerName, IUILayer layer)
Parameters:presentedLayerNamestring

The name of the existing layer that should precede the new layer.

layerIUILayer

The layer to insert.

Returns:

bool

true if the named layer exists and the new layer was inserted; otherwise, false.

Exceptions: InvalidOperationException

A layer with the same name is already registered.

Inserts a layer immediately before the named layer.

C#
public bool AddBefore(string presentedLayerName, IUILayer layer)
Parameters:presentedLayerNamestring

The name of the existing layer that should follow the new layer.

layerIUILayer

The layer to insert.

Returns:

bool

true if the named layer exists and the new layer was inserted; otherwise, false.

Exceptions: InvalidOperationException

A layer with the same name is already registered.

Inserts a layer at the beginning of the display order.

C#
public void AddFirst(IUILayer layer)
Parameters:layerIUILayer

The layer to insert.

Exceptions: InvalidOperationException

A layer with the same name is already registered.

Inserts a layer at the end of the display order.

C#
public void AddLast(IUILayer layer)
Parameters:layerIUILayer

The layer to insert.

Exceptions: InvalidOperationException

A layer with the same name is already registered.

Removes all layers from the stack.

C#
public void Clear()

Determines whether a layer with the specified layer's name is registered.

C#
public bool Contains(IUILayer layer)
Parameters:layerIUILayer

The layer whose name should be checked.

Returns:

bool

true if a layer with that name exists; otherwise, false.

Determines whether a layer with the specified name is registered.

C#
public bool Contains(string layerName)
Parameters:layerNamestring

The layer name to check.

Returns:

bool

true if the name is registered; otherwise, false.

Copies the layers into an array in their current display order.

C#
public void CopyTo(IUILayer[] array, int arrayIndex)
Parameters:arrayIUILayer[]

The destination array.

arrayIndexint

The zero-based index at which copying begins.

Returns an enumerator that visits layers in display order.

C#
public IEnumerator<IUILayer> GetEnumerator()
Returns:

IEnumerator<IUILayer>

An enumerator over the layers.

Gets the layer registered under the specified name.

C#
public IUILayer GetLayerByName(string layerName)
Parameters:layerNamestring

The name used when the layer was added.

Returns:

IUILayer

The matching layer, or null when no layer has that name.

Removes the specified layer from the stack.

C#
public bool Remove(IUILayer layer)
Parameters:layerIUILayer

The layer to remove.

Returns:

bool

true if the layer was present; otherwise, false.

Removes the layer registered under the specified name.

C#
public bool Remove(string layerName)
Parameters:layerNamestring

The name of the layer to remove.

Returns:

bool

true if a layer with that name was removed; otherwise, false.