IsPinvokeImpl Property

FieldInfo.IsPinvokeImpl Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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

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

'Declaration
Public ReadOnly Property IsPinvokeImpl As Boolean

Property Value

Type: System.Boolean
true if the field has the PinvokeImpl attribute set; otherwise, false.

ExceptionCondition
MethodAccessException

This member is invoked late-bound through mechanisms such as Type.InvokeMember.

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


Imports System.Reflection

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

   Public Shared Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock)
      Dim myObject As New Example()

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

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


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft