Share via


PropertyBuilder.GetValue Metode

Definisi

Mendapatkan nilai properti dengan memanggil getter.

Overload

GetValue(Object, Object[])

Mendapatkan nilai properti terindeks dengan memanggil metode getter properti.

GetValue(Object, BindingFlags, Binder, Object[], CultureInfo)

Mendapatkan nilai properti yang memiliki pengikatan, indeks, dan CultureInfo.

GetValue(Object, Object[])

Sumber:
PropertyBuilder.cs

Mendapatkan nilai properti terindeks dengan memanggil metode getter properti.

public:
 override System::Object ^ GetValue(System::Object ^ obj, cli::array <System::Object ^> ^ index);
public override object GetValue (object? obj, object?[]? index);
public override object GetValue (object obj, object[] index);
override this.GetValue : obj * obj[] -> obj
Public Overrides Function GetValue (obj As Object, index As Object()) As Object

Parameter

obj
Object

Objek yang nilai propertinya akan dikembalikan.

index
Object[]

Nilai indeks opsional untuk properti terindeks. Nilai ini harus null untuk properti yang tidak diindeks.

Mengembalikan

Nilai properti terindeks yang ditentukan.

Pengecualian

Metode ini tidak didukung.

Keterangan

Untuk mendapatkan nilai properti, refleksikan pada jenis induk properti menggunakan Type.GetType atau Assembly.GetType, ambil Reflection objek properti dari jenis , dan panggil PropertyInfo.GetValue.

Berlaku untuk

GetValue(Object, BindingFlags, Binder, Object[], CultureInfo)

Sumber:
PropertyBuilder.cs

Mendapatkan nilai properti yang memiliki pengikatan, indeks, dan CultureInfo.

public:
 override System::Object ^ GetValue(System::Object ^ obj, System::Reflection::BindingFlags invokeAttr, System::Reflection::Binder ^ binder, cli::array <System::Object ^> ^ index, System::Globalization::CultureInfo ^ culture);
public override object GetValue (object? obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object?[]? index, System.Globalization.CultureInfo? culture);
public override object GetValue (object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object[] index, System.Globalization.CultureInfo culture);
override this.GetValue : obj * System.Reflection.BindingFlags * System.Reflection.Binder * obj[] * System.Globalization.CultureInfo -> obj
Public Overrides Function GetValue (obj As Object, invokeAttr As BindingFlags, binder As Binder, index As Object(), culture As CultureInfo) As Object

Parameter

obj
Object

Objek yang nilai propertinya akan dikembalikan.

invokeAttr
BindingFlags

Atribut pemanggilan. Ini harus sedikit bendera dari BindingFlags : InvokeMethod, , CreateInstance, Static, SetFieldGetField, GetProperty, , atau SetProperty. Atribut pemanggilan yang sesuai harus ditentukan. Jika anggota statis akan dipanggil, Static bendera BindingFlags harus diatur.

binder
Binder

Objek yang memungkinkan pengikatan, paksaan jenis argumen, pemanggilan anggota, dan pengambilan MemberInfo objek menggunakan pantulan. Jika binder adalah null, pengikat default digunakan.

index
Object[]

Nilai indeks opsional untuk properti terindeks. Nilai ini harus null untuk properti yang tidak diindeks.

culture
CultureInfo

Objek CultureInfo yang mewakili budaya tempat sumber daya akan dilokalkan. Perhatikan bahwa jika sumber daya tidak dilokalkan untuk budaya ini, CultureInfo.Parent metode akan dipanggil secara berturut-turut untuk mencari kecocokan. Jika nilai ini adalah null, CultureInfo nilai diperoleh dari CultureInfo.CurrentUICulture properti .

Mengembalikan

Nilai properti untuk obj.

Pengecualian

Metode ini tidak didukung.

Keterangan

Untuk mendapatkan nilai properti, refleksikan pada jenis induk properti menggunakan Type.GetType atau Assembly.GetType, ambil objek properti Reflection dari jenis , dan panggil PropertyInfo.GetValue.

Berlaku untuk