更新:2007 年 11 月
创建指定类型的实例。
命名空间: Microsoft.Windows.Design.Model
程序集: Microsoft.Windows.Design.Extensibility(在 Microsoft.Windows.Design.Extensibility.dll 中)
语法
声明
Public Overridable Function CreateInstance ( _
type As Type, _
ParamArray arguments As Object() _
) As Object
用法
Dim instance As InstanceFactory
Dim type As Type
Dim arguments As Object()
Dim returnValue As Object
returnValue = instance.CreateInstance(type, _
arguments)
public virtual Object CreateInstance(
Type type,
params Object[] arguments
)
public:
virtual Object^ CreateInstance(
Type^ type,
... array<Object^>^ arguments
)
public function CreateInstance(
type : Type,
... arguments : Object[]
) : Object
参数
type
类型:System.Type要创建的对象的类型。
arguments
类型:array<System.Object[]一个要传递给构造函数的可选参数数组。
返回值
新创建的对象。返回值不应返回 nullnull 引用(在 Visual Basic 中为 Nothing)。
异常
异常 | 条件 |
---|---|
ArgumentNullException | type 为 nullnull 引用(在 Visual Basic 中为 Nothing)。 |
权限
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。
另请参见
参考
Microsoft.Windows.Design.Model 命名空间