SimpleDynamicMemberAccessor.TryGetProperty<T>(Object, String, T) 方法

定义

尝试获取给定对象的属性值 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

类型参数

T

属性的返回类型 propertyName

参数

instance
Object

正在获得其属性的对象实例。

propertyName
String

属性的区分大小写的名称。

propertyValue
T

属性的返回值。

返回

Boolean

适用于