IVsaItems.CreateItem(String, VsaItemType, VsaItemFlag) IVsaItems.CreateItem(String, VsaItemType, VsaItemFlag) IVsaItems.CreateItem(String, VsaItemType, VsaItemFlag) IVsaItems.CreateItem(String, VsaItemType, VsaItemFlag) Method

定义

按照 VsaItemType 枚举中的定义,创建其中一个IVsaItem 类型的新实例。Creates a new instance of one of the IVsaItem types, as defined in the VsaItemType enumeration.

public:
 Microsoft::Vsa::IVsaItem ^ CreateItem(System::String ^ name, Microsoft::Vsa::VsaItemType itemType, Microsoft::Vsa::VsaItemFlag itemFlag);
public Microsoft.Vsa.IVsaItem CreateItem (string name, Microsoft.Vsa.VsaItemType itemType, Microsoft.Vsa.VsaItemFlag itemFlag);
abstract member CreateItem : string * Microsoft.Vsa.VsaItemType * Microsoft.Vsa.VsaItemFlag -> Microsoft.Vsa.IVsaItem
Public Function CreateItem (name As String, itemType As VsaItemType, itemFlag As VsaItemFlag) As IVsaItem

参数

name
String String String String

要与新项关联的名称。The name to associate with the new item. 项是引用项类型时,名称参数必须与被引用程序集的名称(使用 AssemblyName 属性设置)完全相同。In cases where the item is a reference item type, the name parameter must be exactly the same as the name of the referenced assembly, as set with the AssemblyName property. 但是,在 JScript 中,如果不指定 AssemblyName,则 JScript 会将 ItemName 用作程序集的名称。In JScript, however, if you do not specify an AssemblyName, JScript will use the ItemName as the name of the assembly.

itemType
VsaItemType VsaItemType VsaItemType VsaItemType

VsaItemType 枚举中定义的所创建的项类型。The type of item created, as defined in the VsaItemType enumeration.

itemFlag
VsaItemFlag VsaItemFlag VsaItemFlag VsaItemFlag

用于指定代码项初始内容的可选标志。The optional flag to specify the initial content of a Code item.

返回

创建的对象。The object created.

适用于