初始化 PrivateObject 类的新实例。
命名空间:  Microsoft.VisualStudio.TestTools.UnitTesting
程序集:  Microsoft.VisualStudio.QualityTools.UnitTestFramework(在 Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll 中)
语法
声明
Public Sub New ( _
    type As Type, _
    parameterTypes As Type(), _
    args As Object() _
)
public PrivateObject(
    Type type,
    Type[] parameterTypes,
    Object[] args
)
public:
PrivateObject(
    Type^ type, 
    array<Type^>^ parameterTypes, 
    array<Object^>^ args
)
new : 
        type:Type * 
        parameterTypes:Type[] * 
        args:Object[] -> PrivateObject
public function PrivateObject(
    type : Type, 
    parameterTypes : Type[], 
    args : Object[]
)
参数
- type
类型:System.Type
被包装对象类型。 
- parameterTypes
类型:array<System.Type[]
一个 Type 对象数组,表示用于构造对象的参数的数目、顺序和类型。 
- args
类型:array<System.Object[]
用于定义对象的参数。 
异常
| 异常 | 条件 | 
|---|---|
| ArgumentNullException | type 为 nullnull 引用(在 Visual Basic 中为 Nothing)。  | 
| ArgumentException | parameterTypes 是多维的。 - 或 - 无法找到与 PrivateObject 中指定的参数匹配的构造函数。  | 
备注
这将使用所传递的 type、parameterTypes 和 args 参数创建对象。
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。