PrivateType.SetStaticField Method (String, BindingFlags, Object)
Sets a static field contained in the wrapped type.
Namespace: Microsoft.VisualStudio.TestTools.UnitTesting
Assembly: Microsoft.VisualStudio.SmartDevice.UnitTestFramework (in Microsoft.VisualStudio.SmartDevice.UnitTestFramework.dll)
Syntax
'Declaration
Public Sub SetStaticField ( _
name As String, _
invokeAttr As BindingFlags, _
value As Object _
)
'Usage
Dim instance As PrivateType
Dim name As String
Dim invokeAttr As BindingFlags
Dim value As Object
instance.SetStaticField(name, invokeAttr, _
value)
public void SetStaticField(
string name,
BindingFlags invokeAttr,
Object value
)
public:
void SetStaticField(
String^ name,
BindingFlags invokeAttr,
Object^ value
)
public function SetStaticField(
name : String,
invokeAttr : BindingFlags,
value : Object
)
Parameters
name
Type: System.StringThe name of the static field.
invokeAttr
Type: System.Reflection.BindingFlagsA bitmask comprised of one or more BindingFlags that specifies how the search for the field is conducted.
value
Type: System.ObjectThe value to set to the static field.
.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.