IJSVsaItems.CreateItem(String, JSVsaItemType, JSVsaItemFlag) 方法

定义

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

public:
 Microsoft::JScript::Vsa::IJSVsaItem ^ CreateItem(System::String ^ name, Microsoft::JScript::Vsa::JSVsaItemType itemType, Microsoft::JScript::Vsa::JSVsaItemFlag itemFlag);
public Microsoft.JScript.Vsa.IJSVsaItem CreateItem (string name, Microsoft.JScript.Vsa.JSVsaItemType itemType, Microsoft.JScript.Vsa.JSVsaItemFlag itemFlag);
abstract member CreateItem : string * Microsoft.JScript.Vsa.JSVsaItemType * Microsoft.JScript.Vsa.JSVsaItemFlag -> Microsoft.JScript.Vsa.IJSVsaItem
Public Function CreateItem (name As String, itemType As JSVsaItemType, itemFlag As JSVsaItemFlag) As IJSVsaItem

参数

name
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
JSVsaItemType

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

itemFlag
JSVsaItemFlag

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

返回

对创建的 IJSVsaItem 对象的引用。A reference to the IJSVsaItem object created.

适用于