FieldInfo.IsPinvokeImpl Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets a value indicating whether the corresponding PinvokeImpl attribute is set in FieldAttributes.

Namespace:   System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

Public ReadOnly Property IsPinvokeImpl As Boolean

Property Value

Type: System.Boolean

true if the PinvokeImpl attribute is set in FieldAttributes; otherwise, false.

The following example creates a class and displays the name, field and IsPinvokeImpl property value of the field.

Imports System
Imports System.Reflection
Imports Microsoft.VisualBasic

Public Class Fieldinfo_IsPinvoke
    Public myField As String = "A public field"

    Public Shared Sub Main()
        Dim myObject As New Fieldinfo_IsPinvoke()

        ' Get the Type and FieldInfo.
        Dim myType1 As Type = GetType(Fieldinfo_IsPinvoke)
        Dim myFieldInfo As FieldInfo = myType1.GetField("myField", _
           BindingFlags.Public Or BindingFlags.Instance)

        ' Display the name, field and the PInvokeImpl attribute for the field.
        Console.Write(ControlChars.NewLine & "Name of class: {0}", _
                                         myType1.FullName)
        Console.Write(ControlChars.NewLine & "Value of field: {0}", _
                                         myFieldInfo.GetValue(myObject))
        Console.Write(ControlChars.NewLine & "IsPinvokeImpl: {0}", _
                                         myFieldInfo.IsPinvokeImpl)
    End Sub
End Class

.NET Framework
Available since 1.1
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show: