IVsEditorFactoryNotify.NotifyItemAdded Method
Method called when a new file (cloned from a template or existing file) is added to the project.
Namespace: Microsoft.VisualStudio.Shell.Interop
Assembly: Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)
Syntax
‘선언
Function NotifyItemAdded ( _
grfEFN As UInteger, _
pHier As IVsHierarchy, _
itemid As UInteger, _
pszMkDocument As String _
) As Integer
‘사용 방법
Dim instance As IVsEditorFactoryNotify
Dim grfEFN As UInteger
Dim pHier As IVsHierarchy
Dim itemid As UInteger
Dim pszMkDocument As String
Dim returnValue As Integer
returnValue = instance.NotifyItemAdded(grfEFN, _
pHier, itemid, pszMkDocument)
int NotifyItemAdded(
uint grfEFN,
IVsHierarchy pHier,
uint itemid,
string pszMkDocument
)
int NotifyItemAdded(
[InAttribute] unsigned int grfEFN,
[InAttribute] IVsHierarchy^ pHier,
[InAttribute] unsigned int itemid,
[InAttribute] String^ pszMkDocument
)
abstract NotifyItemAdded :
grfEFN:uint32 *
pHier:IVsHierarchy *
itemid:uint32 *
pszMkDocument:string -> int
function NotifyItemAdded(
grfEFN : uint,
pHier : IVsHierarchy,
itemid : uint,
pszMkDocument : String
) : int
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.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
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.
.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
IVsEditorFactoryNotify Interface