FieldInfo.IsPinvokeImpl Vlastnost
V tomto článku
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Získá hodnotu označující, zda PinvokeImpl
odpovídající atribut je nastaven v FieldAttributes.
public:
property bool IsPinvokeImpl { bool get(); };
public bool IsPinvokeImpl { get; }
member this.IsPinvokeImpl : bool
Public ReadOnly Property IsPinvokeImpl As Boolean
true
PinvokeImpl
pokud je atribut nastavený v FieldAttributes, v opačném případě . false
Následující příklad vytvoří třídu a zobrazí název, pole a IsPinvokeImpl hodnotu vlastnosti pole.
using namespace System;
using namespace System::Reflection;
public ref class Fieldinfo_IsPinvoke
{
public:
String^ myField;
Fieldinfo_IsPinvoke()
{
myField = "A public field";
}
};
int main()
{
Fieldinfo_IsPinvoke^ myObject = gcnew Fieldinfo_IsPinvoke;
// Get the Type and FieldInfo.
Type^ myType1 = Fieldinfo_IsPinvoke::typeid;
FieldInfo^ myFieldInfo = myType1->GetField( "myField", static_cast<BindingFlags>(BindingFlags::Public | BindingFlags::Instance) );
// 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 );
}
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",
BindingFlags.Public|BindingFlags.Instance);
// 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 );
}
}
Imports System.Reflection
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
Produkt | Verze |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Zpětná vazba k produktu .NET
.NET je open source projekt. Vyberte odkaz pro poskytnutí zpětné vazby: