wwDotNetBridge::GetProperty

Retrieves a property value from an object instance via Reflection.

Use this method whenever you're dealing with an object such as a generic type of collection or struct that COM doesn't support direct access from FoxPro via COM.

*** Simple Property Retrieval
lcValue = loBridge.GetProperty(loObject,"SomeProperty")

*** Nested Property Retrieval (use sparingly - better to retrieve object first)
lcValue = loBridge.GetProperty(loObject,"SomeObject.SomeProperty")

*** Indexers (int and string only)
lcValue = loBridge.GetProperty(loObject,"SomeCollection[0]")
lcValue = loBridge.GetProperty(loObject,'SomeCollection["name"]')

*** Indexers - on the current instance (int and string only)
lcValue = loBridge.GetProperty(loDataRow,"[0]")
lcValue = loBridge.GetProperty(loDataRow,'["name"]')
o.GetProperty(loInstance, lcProperty)

Return Value

Value of the property or null. Invalid properties or invalid type returns will throw FoxPro/COM errors.

Parameters

loInstance
A .NET object instance

lcProperty
The name of the property to retrieve

The property can also be a 'nested' property like "Address.Street". Use this syntax if a type along the hierarchy is not accessible by FoxPro (Value type, Generic Type etc.)


See also:

Class wwDotNetBridge

© West Wind Technologies, 2024 • Updated: 04/17/24
Comment or report problem with topic