ItemMoved Method

_dispVCProjectEngineEvents.ItemMoved Method (Object, Object, Object)

 

This API supports the product infrastructure and is not intended to be used directly from your code.

Signifies that the specified item was moved within the project.

Namespace:   Microsoft.VisualStudio.VCProjectEngine
Assembly:  Microsoft.VisualStudio.VCProjectEngine (in Microsoft.VisualStudio.VCProjectEngine.dll)

void ItemMoved(
	object Item,
	object NewParent,
	object OldParent
)

Parameters

Item
Type: System.Object

Required. The item.

NewParent
Type: System.Object

Required. The new parent.

OldParent
Type: System.Object

Required. The previous parent.

The ItemMoved method fires when an item is moved in a VCProject, VCFilter, or VCFile object.

[Visual Basic]

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub ItemMoved(ByVal item As Object, ByVal newParent As Object, _
        ByVal oldParent As Object)
        Dim vcitem As VCProjectItem
        vcitem = item
        MsgBox(vcitem)
    End Sub

    Sub Main()
        Dim projEngine As VCProjectEngine
        Dim evt As VCProjectEngineEvents
        Dim prj As VCProject
        Dim col As IVCCollection
        Dim file As VCFile
        Dim folder As VCFilter
        projEngine = DTE.Solution.Projects.Item(1).Object.VCProjectEngine
        prj = DTE.Solution.Projects.Item(1).Object
        evt = projEngine.Events
        AddHandler evt.ItemMoved, AddressOf ItemMoved
        col = prj.Items
        folder = col.Item("Resource Files")
        file = col.Item("ReadMe.txt")
        file.Move(folder)
    End Sub
End Module
Return to top
Show:
© 2016 Microsoft