PrivateObject.GetField Method (String, BindingFlags)
Gets a value from a named field, based on the name and lookup mask.
Namespace: Microsoft.VisualStudio.TestTools.UnitTesting
Assembly: Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)
Syntax
'Declaration
Public Function GetField ( _
name As String, _
bindingFlags As BindingFlags _
) As Object
public Object GetField(
string name,
BindingFlags bindingFlags
)
public:
Object^ GetField(
String^ name,
BindingFlags bindingFlags
)
member GetField :
name:string *
bindingFlags:BindingFlags -> Object
public function GetField(
name : String,
bindingFlags : BindingFlags
) : Object
Parameters
name
Type: StringThe name of the private field to get.
- bindingFlags
Type: BindingFlags
Return Value
Type: Object
The value set for the name field.
Exceptions
Exception | Condition |
---|---|
ArgumentException | name is nulla null reference (Nothing in Visual Basic) or empty. |
.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.