wwDotNetBridge::GetPropertyEx

Retrieves a property value from an object instance via Reflection. This method is an extended property retrieval method that allows for . syntax and array/indexer syntax in the property string value.

Use this method if 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.

While this method is much more flexible than the GetProperty method, it also adds some parsing overhead. If performance is important manual drill down via GetProperty calls may be more efficient.

Supported features:

loBridge = CreateObject("wwDotNetBridge") loItem = loBridge.CreateInstance("MyNameSpace.TestClass") *** Access Nested Properties *** - assuming the type can't be accessed directly from VFP lcStreet = loBridge.GetPropertyEx(loItem,"Address.Street") *** Access Indexer Properties in Collection/Arrays loPerson = loBridge.CreateInstance("MyNameSpace.Person") loPerson.Name = "Rick" loPerson.Company = "West Wind" loItem.Persons.Add(loPerson) && add item to a collection *** Access the indexed item loPerson = loBridge.GetPropertyEx(loItem,"Persons[0]") ? loPerson.Name


o.GetPropertyEx(loInstance, lcProperty)

Return Value

Value

Parameters

loInstance
A .NET object instance

lcProperty
The property or property path to set the value on as a string.

Supports . syntax (Property.ChildProperty.ChildProperty) to drill down into object hierarchy as well as Array/Collection indexers (Item[0])

See also:

Class wwDotNetBridge


  Last Updated: 12/17/2007 | © West Wind Technologies, 2008