FieldInfo.IsPinvokeImpl Property


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

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

public bool IsPinvokeImpl { get; }

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.

using System;
using System.Reflection;

public class Fieldinfo_IsPinvoke
    public string myField = "A public field";

    public static void Main()
        Fieldinfo_IsPinvoke myObject = new Fieldinfo_IsPinvoke();

        // Get the Type and FieldInfo.
        Type myType1 = typeof(Fieldinfo_IsPinvoke);
        FieldInfo myFieldInfo = myType1.GetField("myField",

        // Display the name, field and the PInvokeImpl attribute for the field.
        Console.Write("\n Name of class: {0}", myType1.FullName);
        Console.Write("\n Value of field: {0}", myFieldInfo.GetValue(myObject));
        Console.Write("\n IsPinvokeImpl: {0}", 
            myFieldInfo.IsPinvokeImpl );

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