Redigera

Dela via


_PropertyInfo.GetValue Method

Definition

Provides COM objects with version-independent access to the GetValue methods.

Overloads

GetValue(Object, Object[])

Provides COM objects with version-independent access to the GetValue(Object, Object[]) method.

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

Provides COM objects with version-independent access to the GetValue(Object, BindingFlags, Binder, Object[], CultureInfo) method.

Remarks

This method is for access to managed classes from unmanaged code and should not be called from managed code.

The GetValue methods return the value of the property.

GetValue(Object, Object[])

Provides COM objects with version-independent access to the GetValue(Object, Object[]) method.

public:
 System::Object ^ GetValue(System::Object ^ obj, cli::array <System::Object ^> ^ index);
public object GetValue (object obj, object[] index);
abstract member GetValue : obj * obj[] -> obj
Public Function GetValue (obj As Object, index As Object()) As Object

Parameters

obj
Object

The object whose property value will be returned.

index
Object[]

Optional index values for indexed properties. This value should be null for non-indexed properties.

Returns

The property value for the obj parameter.

Remarks

This method is for access to managed classes from unmanaged code and should not be called from managed code.

The GetValue method returns a literal value associated with the property by a compiler.

Applies to

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

Provides COM objects with version-independent access to the GetValue(Object, BindingFlags, Binder, Object[], CultureInfo) method.

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

Parameters

obj
Object

The object whose property value will be returned.

invokeAttr
BindingFlags

The invocation attribute. This must be a bit flag from BindingFlags: InvokeMethod, CreateInstance, Static, GetField, SetField, GetProperty, or SetProperty. A suitable invocation attribute must be specified. If a static member will be invoked, the Static flag of BindingFlags must be set.

binder
Binder

An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects through reflection. If binder is null, the default binder is used.

index
Object[]

Optional index values for indexed properties. This value should be null for non-indexed properties.

culture
CultureInfo

The CultureInfo object that represents the culture for which the resource will be localized. Note that if the resource is not localized for this culture, the CultureInfo.Parent method will be called successively in search of a match. If this value is null, the CultureInfo is obtained from the CultureInfo.CurrentUICulture property.

Returns

The property value for the obj parameter.

Remarks

This method is for access to managed classes from unmanaged code and should not be called from managed code.

The GetValue method returns the value of a property having the specified binding, index, and CultureInfo.

Applies to