API Reference
DataTablesLabelerRegistry
Registry for per-type and per-property labelers used by DataTables smart value formatters.
Inheritance
- Object
- DataTablesLabelerRegistry
Constructors
public DataTablesLabelerRegistry() #Methods
public Void RegisterAccessor<T>(String propertyName, Func<T, Object> accessor) #VoidType Parameters
- T
Parameters
- propertyName String
- accessor Func<T, Object>
RegisterAccessor``1(System.String propertyName, System.Func{``0,System.Object} accessor) #Registers a typed accessor for a property name on type T. Used by JoinProperty/SmartLabel to read values without reflection (AOT-safe).
Parameters
- propertyName System.String
- accessor System.Func{``0,System.Object}
public Void RegisterForProperty(String propertyName, Func<Object, String> labeler) #VoidRegister a labeler for a property/column name (case-insensitive). Useful for enumerable columns like "Inventory".
Parameters
- propertyName System.String
- labeler System.Func{System.Object,System.String}
public Void RegisterForType<T>(Func<T, String> labeler) #VoidType Parameters
- T
Parameters
- labeler Func<T, String>
RegisterForType``1(System.Func{``0,System.String} labeler) #Register a labeler for a specific type. The most specific type match wins (derived types over bases).
Parameters
- labeler System.Func{``0,System.String}
public Void RegisterProjection<T>(Action<DataTablesProjectionBuilder<T>> build) #VoidType Parameters
- T
Parameters
- build Action<DataTablesProjectionBuilder<T>>
RegisterProjection``1(System.Action{HtmlForgeX.DataTablesProjectionBuilder{``0}} build) #Registers a projection (ordered list of named accessors) for type T. Summarization prefers this projection in AOT scenarios to avoid reflection.
Parameters
- build System.Action{HtmlForgeX.DataTablesProjectionBuilder{``0}}
TryGetAccessor(System.Object arg1, System.String arg2, System.Object@ arg3) #Tries to fetch a typed accessor value for a property by name (case-insensitive). Searches the exact type and its base types.
Parameters
- arg1 System.Object
- arg2 System.String
- arg3 System.Object@
TryGetProjection(System.Object arg1, System.Collections.Generic.List{System.ValueTuple{System.String,System.Func{System.Object,System.Object}}}@ arg2) #Gets a registered projection for the object's runtime type or its base types.
Parameters
- arg1 System.Object
- arg2 System.Collections.Generic.List{System.ValueTuple{System.String,System.Func{System.Object,System.Object}}}@
TryLabelForProperty(System.String arg1, System.Object arg2, System.String@ arg3) #Try to label the value using a registered property labeler. Prevents infinite recursion when a property labeler calls back into SmartLabel with the same property header.
Parameters
- arg1 System.String
- arg2 System.Object
- arg3 System.String@
TryLabelForType(System.Object arg1, System.String@ arg2) #Try to label the value using a registered type labeler. Chooses the most specific registration.
Parameters
- arg1 System.Object
- arg2 System.String@
Inherited Methods
Properties
public List<String> SmartLabelPropertyOrder { get; } #Gets or sets the property name order consulted by SmartLabel when deriving labels from objects. Clients may overwrite this list to change the search order.