HighlightLayerCollection Class
Definition
Manages a collection of highlight layers with Z-ordering. Enumeration and the indexer walk the layers in render order, lowest Avalonia.Controls.Documents.Primitives.Highlighting.IHighlightLayer.ZIndex first.
public class HighlightLayerCollection
Constructors
| Name | Description |
|---|---|
| HighlightLayerCollection | No summary available. |
HighlightLayerCollection Constructor
public HighlightLayerCollection()
Methods
| Name | Description |
|---|---|
| Add | Adds a highlight layer to the collection. |
| Clear | Clears all layers from the collection. |
| GetEnumerator | Returns an enumerator that walks the layers in render order. |
| GetLayer | Gets a layer by name. |
| GetLayers | Gets all layers ordered by Z-index. |
| Remove | Removes a highlight layer from the collection. |
| Render | Renders all visible layers. |
Add Method
Adds a highlight layer to the collection.
public void Add(Avalonia.Controls.Documents.Primitives.Highlighting.IHighlightLayer layer)
Parameters
layer Avalonia.Controls.Documents.Primitives.Highlighting.IHighlightLayer
The layer to add.
Exceptions
Clear Method
Clears all layers from the collection.
public void Clear()
GetEnumerator Method
Returns an enumerator that walks the layers in render order.
public System.Collections.Generic.IEnumerator<Avalonia.Controls.Documents.Primitives.Highlighting.IHighlightLayer> GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<Avalonia.Controls.Documents.Primitives.Highlighting.IHighlightLayer>
GetLayer Method
Gets a layer by name.
public Avalonia.Controls.Documents.Primitives.Highlighting.IHighlightLayer GetLayer(string name)
Parameters
name string
The name of the layer.
Returns
Avalonia.Controls.Documents.Primitives.Highlighting.IHighlightLayer
The layer with the specified name, or null if not found.
GetLayers Method
Gets all layers ordered by Z-index.
public System.Collections.Generic.IEnumerable<Avalonia.Controls.Documents.Primitives.Highlighting.IHighlightLayer> GetLayers()
Returns
System.Collections.Generic.IEnumerable<Avalonia.Controls.Documents.Primitives.Highlighting.IHighlightLayer>
An enumerable of layers ordered by Z-index.
Remarks
Enumerate the collection itself, which walks the same order.
Remove Method
Removes a highlight layer from the collection.
public bool Remove(Avalonia.Controls.Documents.Primitives.Highlighting.IHighlightLayer layer)
Parameters
layer Avalonia.Controls.Documents.Primitives.Highlighting.IHighlightLayer
The layer to remove.
Returns
bool
True if the layer was removed; otherwise, false.
Render Method
Renders all visible layers.
public void Render(Avalonia.Media.DrawingContext context, Avalonia.Controls.Documents.Primitives.ITextView textView)
Parameters
context Avalonia.Media.DrawingContext
The drawing context.
textView Avalonia.Controls.Documents.Primitives.ITextView
The text view for coordinate mapping.
Properties
Count Property
Gets the number of layers in the collection.
public int Count { get; set; }
Item Property
public Avalonia.Controls.Documents.Primitives.Highlighting.IHighlightLayer Item { get; set; }
Events
| Name | Description |
|---|---|
| RegionsChanged | Event raised when any layer's regions change. |
RegionsChanged Event
Event raised when any layer's regions change.
public event EventHandler RegionsChanged