UtilReflectionGetProperty(Type, String, BindingFlags) Method
Searches for the specified property in the specified Type.
Namespace: DevCase.Core.Diagnostics.Assembly.ReflectionAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static PropertyInfo GetProperty(
Type type,
string propName,
BindingFlags bindingFlags = BindingFlags.Instance|BindingFlags.Static|BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.FlattenHierarchy|BindingFlags.GetProperty
)
Public Shared Function GetProperty (
type As Type,
propName As String,
Optional bindingFlags As BindingFlags = BindingFlags.Instance Or BindingFlags.Static Or BindingFlags.Public Or BindingFlags.NonPublic Or BindingFlags.FlattenHierarchy Or BindingFlags.GetProperty
) As PropertyInfo
Dim type As Type
Dim propName As String
Dim bindingFlags As BindingFlags
Dim returnValue As PropertyInfo
returnValue = UtilReflection.GetProperty(type,
propName, bindingFlags)
public:
static PropertyInfo^ GetProperty(
Type^ type,
String^ propName,
BindingFlags bindingFlags = BindingFlags::Instance|BindingFlags::Static|BindingFlags::Public|BindingFlags::NonPublic|BindingFlags::FlattenHierarchy|BindingFlags::GetProperty
)
static member GetProperty :
type : Type *
propName : string *
?bindingFlags : BindingFlags
(* Defaults:
let _bindingFlags = defaultArg bindingFlags BindingFlags.Instance|BindingFlags.Static|BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.FlattenHierarchy|BindingFlags.GetProperty
*)
-> PropertyInfo
No code example is currently available or this language may not be supported.
- type Type
-
The source type to search for the property.
- propName String
-
The name of the property to search for.
- bindingFlags BindingFlags (Optional)
-
Flags that controls binding and the way in which the search for members and types is conducted by Reflection.
PropertyInfo
A
PropertyInfo instance that represents the obtained property.
This is a code example.
No code example is currently available or this language may not be supported.
Dim prop As PropertyInfo = GetProperty(GetType(Form), "Text")
Dim text As String = DirectCast(prop.GetValue(Me), String)
Console.WriteLine(text)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ArgumentNullException
|
|
ArgumentException
|
Property not found using the current flags.
|