Provides utility methods for working with types, including type discovery, component declarations, and type conversion operations.
More...
Provides utility methods for working with types, including type discovery, component declarations, and type conversion operations.
◆ CreateVectoInputDeclaration()
◆ EnsureIdSet()
Ensures that a component has an ID set in its Data property. If no ID exists, generates one using an auto-incrementing counter.
- Parameters
-
| cd | The component declaration to ensure has an ID. |
◆ FindComponentDelarations()
| IEnumerable<(IComponentDeclaration component, string path)> VectoInputManager.Core.TypeUtils.FindComponentDelarations |
( |
object | obj, |
|
|
string? | parentPath = null ) |
|
inlinestatic |
Recursively finds all component declarations within an object hierarchy. Traverses through properties and collections to locate IComponentDeclaration instances.
- Parameters
-
| obj | The root object to search within. |
| parentPath | The path prefix for tracking location (optional, for internal recursion). |
- Returns
- An enumerable of tuples containing each found component and its path.
◆ GetAllComponentDeclarationTypes()
| IReadOnlyList< Type > VectoInputManager.Core.TypeUtils.GetAllComponentDeclarationTypes |
( |
| ) |
|
|
inlinestatic |
Retrieves all concrete types that implement IComponentDeclaration.
- Returns
- A list of all component declaration types.
◆ GetAllVehicleTypes()
| IReadOnlyList< Type > VectoInputManager.Core.TypeUtils.GetAllVehicleTypes |
( |
| ) |
|
|
inlinestatic |
Retrieves all types that implement VectoObjects.AbstractVehicleDeclarationType and includes VehicleDeclarationType.
- Returns
- A list of concrete vehicle declaration types.
◆ GetSelfAndDescendantTypes()
| IEnumerable< Type > VectoInputManager.Core.TypeUtils.GetSelfAndDescendantTypes |
( |
Type | type | ) |
|
|
inlinestatic |
Gets the specified type and all its concrete descendant types.
- Parameters
-
| type | The base type to find descendants for. |
- Returns
- An enumerable of the type itself and all its non-abstract subclasses.
- Exceptions
-
| ArgumentNullException | Thrown when type is null. |
◆ GetTypeByName()
| Type VectoInputManager.Core.TypeUtils.GetTypeByName |
( |
string | typeName | ) |
|
|
inlinestatic |
Resolves a type name to a Type object from the VectoObjects assembly.
- Parameters
-
| typeName | The simple name of the type (without namespace). |
- Returns
- The resolved Type.
- Exceptions
-
| TypeLoadException | Thrown when the type cannot be found. |
◆ GetTypeByNameOrNull()
| ? Type VectoInputManager.Core.TypeUtils.GetTypeByNameOrNull |
( |
string | typeName | ) |
|
|
inlinestatic |
Attempts to resolve a type name to a Type object, returning null if not found.
- Parameters
-
| typeName | The simple name of the type (without namespace). |
- Returns
- The resolved Type, or null if not found.
◆ GetTypeByNameStandardValues()
| Type VectoInputManager.Core.TypeUtils.GetTypeByNameStandardValues |
( |
string | typeName | ) |
|
|
inlinestatic |
Resolves a standard values type name to a Type object from the VectoInputManagerCore assembly.
- Parameters
-
| typeName | The simple name of the type (without namespace). |
- Returns
- The resolved Type.
- Exceptions
-
| TypeLoadException | Thrown when the type cannot be found. |
◆ IsScaffoldingComponent()
Determines if a component is a scaffolding/placeholder component by checking if its Date property is set to default. Scaffolding components are typically empty templates that haven't been properly initialized.
- Parameters
-
| cd | The component declaration to check. |
- Returns
- True if the component is a scaffolding component; otherwise, false.
◆ SetComponentInVectoInputDeclaration()
Sets a component declaration into the appropriate property of a VectoInputDeclaration_v2_2. Handles special REESS component conversion (Battery/Capacitor) automatically.
- Parameters
-
| vectoInputDeclaration | The target declaration to set the component into. |
| component | The component to set. |
- Exceptions
-
| ArgumentNullException | Thrown when either parameter is null. |
| InvalidOperationException | Thrown when no compatible property is found or multiple matches exist. |
The documentation for this class was generated from the following file:
- VectoInputManagerCore/TypeUtils.cs