Name
FieldInfo
Synopsis
This class is an implementation
of MemberInfo
and allows
access to an instance field. Note that, like all reflective objects,
the FieldInfo
instance refers to the metadata concept
of the field within the type, not a particular field within a particular
instance of that type. (This is important when working with or
manipulating the value stored in object instance fields.)
IsAssembly
, IsFamily
, IsFamilyAndAssembly
, IsFamilyOrAssembly
, IsPublic
, and IsPrivate
allow you
to check the visibility of the field. FieldType
returns
the declared type of this field. FieldHandle
is a System.RuntimeFieldHandle
. Use Attributes
to
retrieve the attributes. To see if the FieldInfo
has the NotSerialized
or PinvokeImpl
FieldAttributes
set, inspect
the IsNotSerialized
and IsPinvokeImpl
properties. If the field is shared, IsStatic
is true.
The Set
and Get
methods allow
you set the values, and the ones with Direct
in
their name take a typed reference as opposed to an object.
Public MustInherit Class FieldInfo : Inherits MemberInfo ' Protected Constructors Protected Sub New() ' Public Instance Properties MustInherit Public ReadOnly Property Attributes As FieldAttributes MustInherit Public ReadOnly Property FieldHandle As RuntimeFieldHandle MustInherit Public ReadOnly Property FieldType As Type Public ReadOnly Property IsAssembly As Boolean Public ReadOnly Property IsFamily As Boolean Public ReadOnly Property IsFamilyAndAssembly As Boolean Public ReadOnly Property IsFamilyOrAssembly ...
Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.