PrivateObject.GetFieldOrProperty Method (String, BindingFlags)
Gets a value of a wrapped field or property based on the name.
Namespace: Microsoft.VisualStudio.TestTools.UnitTesting
Assembly: Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)
Syntax
'Declaration
Public Function GetFieldOrProperty ( _
name As String, _
bindingFlags As BindingFlags _
) As Object
public Object GetFieldOrProperty(
string name,
BindingFlags bindingFlags
)
public:
Object^ GetFieldOrProperty(
String^ name,
BindingFlags bindingFlags
)
member GetFieldOrProperty :
name:string *
bindingFlags:BindingFlags -> Object
public function GetFieldOrProperty(
name : String,
bindingFlags : BindingFlags
) : Object
Parameters
name
Type: StringThe name of the private field or property to get.
- bindingFlags
Type: BindingFlags
Return Value
Type: Object
The value set for the name field or property.
Remarks
Important
This is important for Visual Basic source code as fields and properties are used the same way.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.