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.
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: System.Booleantrue if the field has the PinvokeImpl attribute set; otherwise, false.
| Exception | Condition |
|---|---|
| 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.
Note: |
|---|
To run this example, see Building examples that have static TextBlock controls for Windows Phone 8. |
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
Note: