Udostępnij za pośrednictwem


IVsAddProjectItemDlg2.AddProjectItemDlgTitledEx Method

Definition

Provides additional functionality to the AddProjectItemDlgTitled(UInt32, Guid, IVsProject, UInt32, String, String, String, String, String, Int32) method such as treeview, help, and default directory selection and expansion.

public:
 int AddProjectItemDlgTitledEx(System::UInt32 itemidLoc, Guid % rguidProject, Microsoft::VisualStudio::Shell::Interop::IVsProject ^ pProject, System::UInt32 grfAddFlags, System::String ^ lpszDlgTitle, System::String ^ lpszTreeViewTitle, System::String ^ lpszHelpTopic, System::String ^ lpszExpand, System::String ^ lpszSelect, [Runtime::InteropServices::Out] System::String ^ % pbstrLocation, [Runtime::InteropServices::Out] System::String ^ % pbstrFilter, [Runtime::InteropServices::Out] int % pfDontShowAgain);
public int AddProjectItemDlgTitledEx (uint itemidLoc, ref Guid rguidProject, Microsoft.VisualStudio.Shell.Interop.IVsProject pProject, uint grfAddFlags, string lpszDlgTitle, string lpszTreeViewTitle, string lpszHelpTopic, string lpszExpand, string lpszSelect, out string pbstrLocation, out string pbstrFilter, out int pfDontShowAgain);
abstract member AddProjectItemDlgTitledEx : uint32 * Guid * Microsoft.VisualStudio.Shell.Interop.IVsProject * uint32 * string * string * string * string * string * string * string * int -> int
Public Function AddProjectItemDlgTitledEx (itemidLoc As UInteger, ByRef rguidProject As Guid, pProject As IVsProject, grfAddFlags As UInteger, lpszDlgTitle As String, lpszTreeViewTitle As String, lpszHelpTopic As String, lpszExpand As String, lpszSelect As String, ByRef pbstrLocation As String, ByRef pbstrFilter As String, ByRef pfDontShowAgain As Integer) As Integer

Parameters

itemidLoc
UInt32

[in] Item identifier of the folder in the project to which items should be added. This is useful only 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(UInt32, VSADDITEMOPERATION, String, UInt32, String[], IntPtr, VSADDRESULT[]).

rguidProject
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.

pProject
IVsProject

[in] Pointer to the IVsProject3 interface the dialog box uses to generate default names for each item by calling the interface's GenerateUniqueItemName(UInt32, String, String, String) method and to cause items to be added to the project by calling the AddItem(UInt32, VSADDITEMOPERATION, String, UInt32, String[], IntPtr, VSADDRESULT[]) method.

grfAddFlags
UInt32

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

lpszDlgTitle
String

[in] Dialog box caption.

lpszTreeViewTitle
String

[in] Treeview caption. null == "Categories".

lpszHelpTopic
String

[in] The name of the Help topic. null == "vs.add[new|existing] item.".

lpszExpand
String

[in] The directory to select or expand by default.

lpszSelect
String

[in] Item to select.

pbstrLocation
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
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
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(UInt32, VSADDITEMOPERATION, String, UInt32, String[], IntPtr, VSADDRESULT[]) method. Typically, a project maintains a separate Don't Show Again option for each item type, such as Form, Module, and Class.

Returns

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

Remarks

COM Signature

From vsshell.idl:

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

Applies to