共用方式為


PrivateObject.GetProperty 方法 (String, array<Type[], array<Object )

取得由名稱所識別之包裝物件的屬性。

命名空間:  Microsoft.VisualStudio.TestTools.UnitTesting
組件:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (在 Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll 中)

語法

'宣告
Public Function GetProperty ( _
    name As String, _
    parameterTypes As Type(), _
    args As Object() _
) As Object
public Object GetProperty(
    string name,
    Type[] parameterTypes,
    Object[] args
)
public:
Object^ GetProperty(
    String^ name, 
    array<Type^>^ parameterTypes, 
    array<Object^>^ args
)
member GetProperty : 
        name:string * 
        parameterTypes:Type[] * 
        args:Object[] -> Object 
public function GetProperty(
    name : String, 
    parameterTypes : Type[], 
    args : Object[]
) : Object

參數

  • parameterTypes
    型別:array<System.Type[]
    Type 物件的陣列,表示所要取得之索引屬性的參數數目、順序和型別。
  • args
    型別:array<System.Object[]
    包含引數的陣列,這個引數將傳遞給所要叫用的成員。

傳回值

型別:System.Object
包含屬性值 (由 name 所識別) 的物件。

例外狀況

例外狀況 條件
ArgumentException

name 為 nullNull 參照 (即 Visual Basic 中的 Nothing) 或是空的。

.NET Framework 安全性

請參閱

參考

PrivateObject 類別

GetProperty 多載

Microsoft.VisualStudio.TestTools.UnitTesting 命名空間