Partager via


IVsAddProjectItemDlg2.AddProjectItemDlgTitled Method

Allows adding or changing a caption on the Add Project Item dialog box.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Declaration
Function AddProjectItemDlgTitled ( _
    itemidLoc As UInteger, _
    ByRef rguidProject As Guid, _
    pProject As IVsProject, _
    grfAddFlags As UInteger, _
    lpszDlgTitle As String, _
    lpszExpand As String, _
    lpszSelect As String, _
    <OutAttribute> ByRef pbstrLocation As String, _
    <OutAttribute> ByRef pbstrFilter As String, _
    <OutAttribute> ByRef pfDontShowAgain As Integer _
) As Integer
int AddProjectItemDlgTitled(
    uint itemidLoc,
    ref Guid rguidProject,
    IVsProject pProject,
    uint grfAddFlags,
    string lpszDlgTitle,
    string lpszExpand,
    string lpszSelect,
    out string pbstrLocation,
    out string pbstrFilter,
    out int pfDontShowAgain
)
int AddProjectItemDlgTitled(
    [InAttribute] unsigned int itemidLoc, 
    [InAttribute] Guid% rguidProject, 
    [InAttribute] IVsProject^ pProject, 
    [InAttribute] unsigned int grfAddFlags, 
    [InAttribute] String^ lpszDlgTitle, 
    [InAttribute] String^ lpszExpand, 
    [InAttribute] String^ lpszSelect, 
    [InAttribute] [OutAttribute] String^% pbstrLocation, 
    [InAttribute] [OutAttribute] String^% pbstrFilter, 
    [OutAttribute] int% pfDontShowAgain
)
abstract AddProjectItemDlgTitled : 
        itemidLoc:uint32 * 
        rguidProject:Guid byref * 
        pProject:IVsProject * 
        grfAddFlags:uint32 * 
        lpszDlgTitle:string * 
        lpszExpand:string * 
        lpszSelect:string * 
        pbstrLocation:string byref * 
        pbstrFilter:string byref * 
        pfDontShowAgain:int byref -> int
function AddProjectItemDlgTitled(
    itemidLoc : uint, 
    rguidProject : Guid, 
    pProject : IVsProject, 
    grfAddFlags : uint, 
    lpszDlgTitle : String, 
    lpszExpand : String, 
    lpszSelect : String, 
    pbstrLocation : String, 
    pbstrFilter : String, 
    pfDontShowAgain : int
) : int

Parameters

  • itemidLoc
    Type: UInt32

    [in] Item identifier of the folder in the project to which items should be added. This is only useful for directory-based projects. Non-directory-based projects pass VSITEMID_ROOT. The Add Item dialog box does not use the parameter except to pass it back to AddItem.

  • rguidProject
    Type: Guid%

    [in] Identifier for the project type. This identifier should be registered under the Projects subkey of the Microsoft Visual Studio registry key. The dialog box uses the following information under that key:

    ItemTemplateDir value, which should contain the path to the directory containing item templates for this project type.

    Filters key, which is used to construct open filters for the Existing tab.

    The dialog box displays items and filters specific to this project type.

  • grfAddFlags
    Type: UInt32

    [in] Flag values that modify the behavior of the dialog box. Values are taken from the __VSADDITEMFLAGS enumeration.

  • lpszDlgTitle
    Type: String

    [in] Dialog box caption.

  • lpszExpand
    Type: String

    [in] Subfolder of the item template directory to select (and expand, if it has subfolders of its own). This initializes the state of the tree and does not affect what the item template directory is.

  • lpszSelect
    Type: String

    [in] Item within the pszExpand folder to be selected. The project uses this parameter to implement a sticky behavior for the selected folder, in which item selection persists between sessions. This parameter overrides the default behavior for the dialog box, which is to select the first item in the folder.

  • pbstrLocation
    Type: String%

    [in, out] Pointer to the location field (initial/final value). This parameter is used only if you specify a value of VSADDITEM_ShowLocationField. To have the project implement sticky behavior, which is the recommended behavior, for the location field, pass the last location field value back in when you open the dialog box again.

  • pbstrFilter
    Type: String%

    [in, out] Value of the filter string on the Existing tab. Specify a value of VSADDITEM_AllowStickyFilter instead of VSADDITEM_AllowStickyFilter is set. To have the project implement a sticky behavior for the filter field, which is the recommended behavior, pass the last filter field value back in when you open the dialog box again.

  • pfDontShowAgain
    Type: Int32%

    [out] Indicator of whether the user selected or cleared the Don't Show This Dialog Again option. This parameter is used only if you specify VSADDITEM_ShowDontShowAgain. To implement the option, which is the recommended behavior, call directly the last selected item template's AddItem method. Typically, a project maintains a separate Don't Show Again option for each item type, such as Form, Module, and Class.

Return Value

Type: Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsAddProjectItemDlg2::AddProjectItemDlgTitled(
   [in] VSITEMID itemidLoc,
   [in] REFGUID rguidProject,
   [in] IVsProject *pProject,
   [in] VSADDITEMFLAGS grfAddFlags,
   [in] LPCOLESTR lpszDlgTitle,
   [in] LPCOLESTR lpszExpand,
   [in] LPCOLESTR lpszSelect,
   [in, out] BSTR *pbstrLocation,
   [in, out] BSTR *pbstrFilter,
   [out] BOOL *pfDontShowAgain
);

.NET Framework Security

See Also

Reference

IVsAddProjectItemDlg2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace