UtilReflectionGetField(Type, String, BindingFlags) Method
Searches for the specified field 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 FieldInfo GetField(
Type type,
string fieldName,
BindingFlags bindingFlags = BindingFlags.Instance|BindingFlags.Static|BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.FlattenHierarchy|BindingFlags.GetField
)
Public Shared Function GetField (
type As Type,
fieldName As String,
Optional bindingFlags As BindingFlags = BindingFlags.Instance Or BindingFlags.Static Or BindingFlags.Public Or BindingFlags.NonPublic Or BindingFlags.FlattenHierarchy Or BindingFlags.GetField
) As FieldInfo
Dim type As Type
Dim fieldName As String
Dim bindingFlags As BindingFlags
Dim returnValue As FieldInfo
returnValue = UtilReflection.GetField(type,
fieldName, bindingFlags)
public:
static FieldInfo^ GetField(
Type^ type,
String^ fieldName,
BindingFlags bindingFlags = BindingFlags::Instance|BindingFlags::Static|BindingFlags::Public|BindingFlags::NonPublic|BindingFlags::FlattenHierarchy|BindingFlags::GetField
)
static member GetField :
type : Type *
fieldName : string *
?bindingFlags : BindingFlags
(* Defaults:
let _bindingFlags = defaultArg bindingFlags BindingFlags.Instance|BindingFlags.Static|BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.FlattenHierarchy|BindingFlags.GetField
*)
-> FieldInfo
No code example is currently available or this language may not be supported.
- type Type
-
The source type to search for the field.
- fieldName String
-
The name of the field 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.
FieldInfo
A
FieldInfo instance that represents the obtained field.
This is a code example.
No code example is currently available or this language may not be supported.
Dim field As FieldInfo = GetField(GetType(Form), "userWindowText")
Dim text As String = DirectCast(field.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.