DevForce Help Reference
GetProperty(Type,String,BindingFlags) Method


Can be used in place of System.Type.GetProperty(System.String).
Syntax
'Declaration
 
Public Overloads Shared Function GetProperty( _
   ByVal pType As Type, _
   ByVal pPropertyName As String, _
   ByVal flags As BindingFlags _
) As PropertyInfo
'Usage
 
Dim pType As Type
Dim pPropertyName As String
Dim flags As BindingFlags
Dim value As PropertyInfo
 
value = ReflectionFns.GetProperty(pType, pPropertyName, flags)
public static PropertyInfo GetProperty( 
   Type pType,
   string pPropertyName,
   BindingFlags flags
)

Parameters

pType
pPropertyName
flags
Remarks
Should be used in place of Type.GetProperty(propertyName) because of problems with AmbiguousMatchException. When multiple public properties exist with the same name (can be caused by marking a property with 'new' in a derived class) this method returns the most derived class that implements the property.
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ReflectionFns Class
ReflectionFns Members
Overload List

Send Feedback