IVstaProjectHostItemCollection.AddProjectHostItem Method (String, String, String, String, String, Boolean)
Adds a new host item to the project based on the specified host item information, and optionally generates code for the new host item.
Namespace: Microsoft.VisualStudio.Tools.Applications.DesignTime.Interop
Assembly: Microsoft.VisualStudio.Tools.Applications.DesignTime.v9.0 (in Microsoft.VisualStudio.Tools.Applications.DesignTime.v9.0.dll)
Syntax
'Declaration
Function AddProjectHostItem ( _
name As String, _
baseType As String, _
interfaceType As String, _
cookie As String, _
templatePath As String, _
generateCode As Boolean _
) As IVstaProjectHostItem
'Usage
Dim instance As IVstaProjectHostItemCollection
Dim name As String
Dim baseType As String
Dim interfaceType As String
Dim cookie As String
Dim templatePath As String
Dim generateCode As Boolean
Dim returnValue As IVstaProjectHostItem
returnValue = instance.AddProjectHostItem(name, _
baseType, interfaceType, cookie, _
templatePath, generateCode)
IVstaProjectHostItem AddProjectHostItem(
string name,
string baseType,
string interfaceType,
string cookie,
string templatePath,
bool generateCode
)
IVstaProjectHostItem^ AddProjectHostItem(
String^ name,
String^ baseType,
String^ interfaceType,
String^ cookie,
String^ templatePath,
bool generateCode
)
function AddProjectHostItem(
name : String,
baseType : String,
interfaceType : String,
cookie : String,
templatePath : String,
generateCode : boolean
) : IVstaProjectHostItem
Parameters
name
Type: System.StringThe identifier of the host item to add.
baseType
Type: System.StringThe fully qualified name of the base proxy class of the host item.
interfaceType
Type: System.StringThe fully qualified name of the Visual Studio Tools for Applications base runtime interface type.
cookie
Type: System.StringThe name that identifies a unique instance of a project host item.
templatePath
Type: System.StringThe full path of the host item template file excluding the file name extension.
generateCode
Type: System.Booleantrue to auto-generate code in the designer code file for the new host item; false to not generate any code.
Return Value
Type: Microsoft.VisualStudio.Tools.Applications.DesignTime.Interop.IVstaProjectHostItem
The new host item object that was added to the project.
Remarks
Pass false for the generateCode parameter if you want to provide custom code. Calling this method with false for the generateCode parameter adds an empty designer code file and empty XML blueprint file to the project.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
IVstaProjectHostItemCollection Interface
IVstaProjectHostItemCollection Members
Microsoft.VisualStudio.Tools.Applications.DesignTime.Interop Namespace