共用方式為


SimpleDynamicMemberAccessor.TryGetProperty<T>(Object, String, T) Method

Definition

Attempts to get a value of a property of given object instance.

public:
generic <typename T>
 bool TryGetProperty(System::Object ^ instance, System::String ^ propertyName, [Runtime::InteropServices::Out] T % propertyValue);
public bool TryGetProperty<T> (object instance, string propertyName, out T propertyValue);
member this.TryGetProperty : obj * string * 'T -> bool
Public Function TryGetProperty(Of T) (instance As Object, propertyName As String, ByRef propertyValue As T) As Boolean

Type Parameters

T

Return type of the propertyName property.

Parameters

instance
Object

Object instance whose property is being gotten.

propertyName
String

The case sensitive name of the property.

propertyValue
T

Return value of the property.

Returns

Applies to