Class DynamicHelper
Helper class to reflect dynamic objects and also maintains cache for faster reflection.
Implements
Inherited Members
Namespace: Syncfusion.Maui.DataSource.Extensions
Assembly: Syncfusion.Maui.DataSource.dll
Syntax
public class DynamicHelper : IDisposable
Constructors
DynamicHelper()
Initializes a new instance of the DynamicHelper class.
Declaration
public DynamicHelper()
Methods
CheckIsDynamicObject(Type)
Determines whether the specified type contains dynamic object.
Declaration
public static bool CheckIsDynamicObject(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | Represents the specified type. |
Returns
| Type | Description |
|---|---|
| bool | Returns the boolean value accordingly. |
Dispose()
Disposes all the allocated resource.
Declaration
public void Dispose()
Dispose(bool)
Dispose the instances, if parameter is true.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | Represents the boolean value for disposing objects. |
GetValue(object, string)
Helper method to get the value from the specified property name.
Declaration
[RequiresUnreferencedCode("The GetValue is not trim compatible")]
[RequiresDynamicCode("This method relies on dynamic code generation.")]
public object GetValue(object dynamicMetaObject, string propName)
Parameters
| Type | Name | Description |
|---|---|---|
| object | dynamicMetaObject | Represents the dynamic meta object. |
| string | propName | Represents the property name. |
Returns
| Type | Description |
|---|---|
| object | Returns the value. |
IsComplexCollection(IDynamicMetaObjectProvider, string)
Determines whether the obtained collection is complex or not.
Declaration
[RequiresUnreferencedCode("The IsComplexCollection is not trim compatible")]
[RequiresDynamicCode("This method relies on dynamic code generation.")]
public static bool IsComplexCollection(IDynamicMetaObjectProvider dynamicMetaObjectProvider, string propName)
Parameters
| Type | Name | Description |
|---|---|---|
| IDynamicMetaObjectProvider | dynamicMetaObjectProvider | Represents the IDynamicMetaObjectProvider object. |
| string | propName | Represents the property name. |
Returns
| Type | Description |
|---|---|
| bool | Returns the boolean value accordingly. |
IsPythonType(string)
Determines whether the obtained property name is python type or not.
Declaration
public static bool IsPythonType(string propName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propName | Represents the property name. |
Returns
| Type | Description |
|---|---|
| bool | Returns the boolean value accordingly. |
SetValue(object, string, object)
Helper method to set the value for the specified property name.
Declaration
public void SetValue(object dynamicMetaObject, string propName, object value)
Parameters
| Type | Name | Description |
|---|---|---|
| object | dynamicMetaObject | Represents the dynamic meta object. |
| string | propName | Represents the property name. |
| object | value | Represents the value to be set. |
ValidateProperty(IDynamicMetaObjectProvider, string)
Determines whether the meta data contains the specified property name.
Declaration
public static bool ValidateProperty(IDynamicMetaObjectProvider dynamicMetaObjectProvider, string propName)
Parameters
| Type | Name | Description |
|---|---|---|
| IDynamicMetaObjectProvider | dynamicMetaObjectProvider | Represents the IDynamicMetaObjectProvider object. |
| string | propName | Represents the property name. |
Returns
| Type | Description |
|---|---|
| bool | Returns the boolean value accordingly. |