Click or drag to resize

ExtensionsReflectionGetPropertyValue Method (Object, String, BindingFlags)

Searches for the specified property, using the specified binding constraints and returns its value.

Namespace:  Cauldron
Assembly:  Cauldron.Activator (in Cauldron.Activator.dll) Version: 3.2.0.2
Syntax
public static Object GetPropertyValue(
	this Object obj,
	string propertyName,
	BindingFlags bindingFlags
)

Parameters

obj
Type: SystemObject
The Object to retrieve the value from
propertyName
Type: SystemString
The string containing the name of the property to get.
bindingFlags
Type: System.ReflectionBindingFlags
A bitmask comprised of one or more BindingFlags that specify how the search is conducted.

Zero, to return null.

Return Value

Type: Object
The property value of the specified object.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Object. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionobj is null
NullReferenceException The property defined by propertyName was not found
See Also