DevForce Help Reference
GetProperty(Type,String) Method


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

Parameters

pType
pPropertyName
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
FindPropertyOrField(Type,String,Boolean,Boolean) Method

Send Feedback