ModelFactory.CreateItem 方法 (EditingContext, TypeIdentifier, CreateOptions, array<Object )
为指定的类型标识符创建一个新的模型项。
命名空间: Microsoft.Windows.Design.Model
程序集: Microsoft.Windows.Design.Interaction(在 Microsoft.Windows.Design.Interaction.dll 中)
语法
声明
Public Shared Function CreateItem ( _
context As EditingContext, _
typeIdentifier As TypeIdentifier, _
options As CreateOptions, _
ParamArray arguments As Object() _
) As ModelItem
public static ModelItem CreateItem(
EditingContext context,
TypeIdentifier typeIdentifier,
CreateOptions options,
params Object[] arguments
)
public:
static ModelItem^ CreateItem(
EditingContext^ context,
TypeIdentifier typeIdentifier,
CreateOptions options,
... array<Object^>^ arguments
)
static member CreateItem :
context:EditingContext *
typeIdentifier:TypeIdentifier *
options:CreateOptions *
arguments:Object[] -> ModelItem
public static function CreateItem(
context : EditingContext,
typeIdentifier : TypeIdentifier,
options : CreateOptions,
... arguments : Object[]
) : ModelItem
参数
- context
类型:Microsoft.Windows.Design.EditingContext
设计器的编辑上下文。
- typeIdentifier
类型:Microsoft.Windows.Design.Metadata.TypeIdentifier
要创建的项的类型的标识符。
- options
类型:Microsoft.Windows.Design.Model.CreateOptions
创建该项时要使用的一组创建选项。默认值为 None。
- arguments
类型:array<System.Object[]
一个应传递给该项的构造函数的可选参数数组。
返回值
类型:Microsoft.Windows.Design.Model.ModelItem
一个 ModelItem,表示新建的项类型。如果未能解析该类型标识符,则此方法可能会返回 nullnull 引用(在 Visual Basic 中为 Nothing)。
异常
异常 | 条件 |
---|---|
ArgumentNullException | context 为 nullnull 引用(在 Visual Basic 中为 Nothing)。 |
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。
请参见
参考
Microsoft.Windows.Design.Model 命名空间