UtilReflectionGetAllFields(Type, Boolean, BindingFlags) Method
Gets all the fields declared 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 IEnumerable<FieldInfo> GetAllFields(
Type type,
bool includeBaseTypes,
BindingFlags bindingFlags = BindingFlags.DeclaredOnly|BindingFlags.Instance|BindingFlags.Static|BindingFlags.Public|BindingFlags.NonPublic
)
Public Shared Function GetAllFields (
type As Type,
includeBaseTypes As Boolean,
Optional bindingFlags As BindingFlags = BindingFlags.DeclaredOnly Or BindingFlags.Instance Or BindingFlags.Static Or BindingFlags.Public Or BindingFlags.NonPublic
) As IEnumerable(Of FieldInfo)
Dim type As Type
Dim includeBaseTypes As Boolean
Dim bindingFlags As BindingFlags
Dim returnValue As IEnumerable(Of FieldInfo)
returnValue = UtilReflection.GetAllFields(type,
includeBaseTypes, bindingFlags)
public:
static IEnumerable<FieldInfo^>^ GetAllFields(
Type^ type,
bool includeBaseTypes,
BindingFlags bindingFlags = BindingFlags::DeclaredOnly|BindingFlags::Instance|BindingFlags::Static|BindingFlags::Public|BindingFlags::NonPublic
)
static member GetAllFields :
type : Type *
includeBaseTypes : bool *
?bindingFlags : BindingFlags
(* Defaults:
let _bindingFlags = defaultArg bindingFlags BindingFlags.DeclaredOnly|BindingFlags.Instance|BindingFlags.Static|BindingFlags.Public|BindingFlags.NonPublic
*)
-> IEnumerable<FieldInfo>
No code example is currently available or this language may not be supported.
- type Type
-
The source Type.
- includeBaseTypes Boolean
-
If , the search include fields declared in base types too.
- bindingFlags BindingFlags (Optional)
-
Flags that controls binding and the way in which the search for members and types is conducted by Reflection.
IEnumerableFieldInfo
A
IEnumerableT collection with all the fields found.
This is a code example.
No code example is currently available or this language may not be supported.
Dim fields As IEnumerable(Of FieldInfo) = GetAllFields(GetType(Form), includeBaseTypes:=True)
For Each field As FieldInfo In fields
Console.WriteLine(field.Name)
Next field
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.