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

Imposta una proprietà indicizzata per un oggetto di cui si è eseguito il wrapping identificato in base al nome.

Spazio dei nomi:  Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

Sintassi

'Dichiarazione
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[]
)

Parametri

  • parameterTypes
    Tipo: array<System.Type[]
    Matrice di oggetti Type che rappresentano il numero, l'ordine e il tipo di parametri per la proprietà dell'oggetto indicizzato da ottenere.
  • value
    Tipo: System.Object
    Il valore di impostazione della proprietà identificata dal name.
  • args
    Tipo: array<System.Object[]
    Una matrice contenente gli argomenti da passare alla proprietà da richiamare.

Eccezioni

Eccezione Condizione
ArgumentException

name è nullriferimento null (Nothing in Visual Basic) o vuoto.

Sicurezza di .NET Framework

Vedere anche

Riferimenti

PrivateObject Classe

Overload SetProperty

Spazio dei nomi Microsoft.VisualStudio.TestTools.UnitTesting