Identifiers
Thin Python wrappers around the C# FlaUI.Core.Identifiers types. They expose the native
id/name, compare by id, and read availability metadata, while the ids themselves come straight
from the C# registry (no re-registration, no drift).
flaui.core.identifiers
Python wrappers for FlaUI C# automation identifiers.
These thin wrappers expose the C# FlaUI.Core.Identifiers types (PropertyId, EventId,
PatternId, TextAttributeId) with Pythonic id/name access, value-equality by id, and
a readable repr. The ids are sourced from the C# registry, so there is no risk of drift.
EventId
IdentifierBase
Bases: BaseModel
Thin Python wrapper around a C# FlaUI identifier.
The wrapper holds the underlying C# identifier instance and exposes its native Id and
Name Pythonically. Equality and hashing are based on the id, mirroring the C# behaviour, so
wrapped identifiers can be compared and used as dictionary keys. The wrapper deliberately does
not re-register identifiers in Python: the ids come straight from the C# registry to avoid drift.
id
property
Return the native identifier id.
Returns:
| Type | Description |
|---|---|
int
|
The integer id assigned by the UI Automation framework. |
name
property
Return the readable identifier name.
Returns:
| Type | Description |
|---|---|
str
|
The human-readable identifier name. |
__eq__(other)
Return whether two identifiers share the same id (mirrors C# IEquatable).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other
|
object
|
The object to compare against. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in flaui/core/identifiers/identifier_base.py
__hash__()
Hash by id, matching C# GetHashCode.
Returns:
| Type | Description |
|---|---|
int
|
The identifier id used as the hash. |
__repr__()
Return 'Name [#Id]' like the C# ToString().
Returns:
| Type | Description |
|---|---|
str
|
A readable representation of the identifier. |
validate_raw(v, info)
classmethod
Reject a missing C# identifier reference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
v
|
Any
|
The candidate C# identifier. |
required |
info
|
ValidationInfo
|
Pydantic validation context. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The validated C# identifier. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the identifier reference is |
Source code in flaui/core/identifiers/identifier_base.py
PatternId
Bases: IdentifierBase
Python wrapper around a C# PatternId (identifies an automation pattern).
availability_property
property
Return the property indicating whether the pattern is available, if any.
Returns:
| Type | Description |
|---|---|
Optional[PropertyId]
|
A :class: |
PropertyId
TextAttributeId
Bases: IdentifierBase
Python wrapper around a C# TextAttributeId (identifies a text-range attribute).