IVsEditorFactoryNotify::NotifyItemAdded Method (UInt32, IVsHierarchy^, UInt32, String^)
Method called when a new file (cloned from a template or existing file) is added to the project.
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
int NotifyItemAdded( unsigned int grfEFN, IVsHierarchy^ pHier, unsigned int itemid, String^ pszMkDocument )
Parameters
- grfEFN
-
Type:
System::UInt32
[in] An EFNFLAGS value indicating the file's origin and how to add it. Bit flags constructed with values from the __EFNFLAGS enumeration.
- pHier
-
Type:
Microsoft.VisualStudio.Shell.Interop::IVsHierarchy^
[in] Pointer to the IVsHierarchy of the project to add the item to.
- itemid
-
Type:
System::UInt32
[in] The item ID (VSITEMID) of the file being added.
- pszMkDocument
-
Type:
System::String^
[in] Pointer to a string containing the path and file name.
Return Value
Type: System::Int32If the method succeeds, it returns S_OK. If it fails, it returns an error code.
From vsshell.idl:
HRESULT IVsEditorFactoryNotify::NotifyItemAdded( [in] EFNFLAGS grfEFN, [in] IVsHierarchy *pHier, [in] VSITEMID itemid, [in] LPCOLESTR pszMkDocument );
Notes to Implementers:
Implementations must appropriately set VSHPROPID_ItemSubType on the project item. Implementations may also perform other processing on the file or set other project state as appropriate.
Call this method just after cloning the template file but before opening the editor or calling the OnAfterAddFiles method of the IVsTrackProjectDocuments2 interface.