C-DEngine 5.105

TheCommonUtils..::..GetPropValue Method

Returns the value of a property.

Namespace:  nsCDEngine.BaseClasses
Assembly:  C-DEngine (in C-DEngine.dll)

Syntax


public static Object GetPropValue(
	Object src,
	string propName
)
Public Shared Function GetPropValue ( _
	src As Object, _
	propName As String _
) As Object
public:
static Object^ GetPropValue(
	Object^ src, 
	String^ propName
)

Parameters

src
Type: Object
The object containing the property.
propName
Type: String
The propety name.

Return Value

The value for the property, or null.

Remarks


There are two ways to call this function:
(1) On a static snapshot of a thing property bag, or
(2) On the C# properties for a TheThing / ICDEThing object.

This code fragment demonstrates the first approach:
C#
TheThingStore tstore = TheThingStore.CloneFromTheThing(MyBaseThing, false);
Object pPropValue1 = TheCommonUtils.GetPropValue(tstore, "SampleProperty");
This code fragment demonstrates the second approach, which uses Reflection in the .NET Framework to locate the specfied C# property:
C#
Object pPropValue2 = TheCommonUtils.GetPropValue(this, "SampleProperty");