InstanceFactory.CreateInstance 方法

更新: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[]

    一个要传递给构造函数的可选参数数组。

返回值

类型:System.Object

新创建的对象。返回值不应返回 nullnull 引用(在 Visual Basic 中为 Nothing)。

异常

异常 条件
ArgumentNullException

type 为 nullnull 引用(在 Visual Basic 中为 Nothing)。

权限

另请参见

参考

InstanceFactory 类

InstanceFactory 成员

Microsoft.Windows.Design.Model 命名空间

其他资源

WPF 设计器扩展性体系结构