共用方式為


PrivateObject.SetProperty Method (String, array<Type[], Object, array<Object )

Sets an indexed property for a wrapped object identified by name.

Namespace:  Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

Syntax

'Declaration
Public Sub SetProperty ( _
    name As String, _
    parameterTypes As Type(), _
    value As Object, _
    args As Object() _
)
public void SetProperty(
    string name,
    Type[] parameterTypes,
    Object value,
    Object[] args
)
public:
void SetProperty(
    String^ name, 
    array<Type^>^ parameterTypes, 
    Object^ value, 
    array<Object^>^ args
)
member SetProperty : 
        name:string * 
        parameterTypes:Type[] * 
        value:Object * 
        args:Object[] -> unit
public function SetProperty(
    name : String, 
    parameterTypes : Type[], 
    value : Object, 
    args : Object[]
)

Parameters

  • name
    Type: String

    The name of property to invoke.

  • parameterTypes
    Type: array<Type[]

    An array of Type objects that represents the number, order, and type of the parameters for the indexed property to get.

  • value
    Type: Object

    The value to set the property identified by name.

  • args
    Type: array<Object[]

    An array that contains the arguments to pass to the property to invoke.

Exceptions

Exception Condition
ArgumentException

name is nulla null reference (Nothing in Visual Basic) or empty.

.NET Framework Security

See Also

Reference

PrivateObject Class

SetProperty Overload

Microsoft.VisualStudio.TestTools.UnitTesting Namespace